1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-20 23:49:23 +00:00
Commit graph

7 commits

Author SHA1 Message Date
silverwind 938b591994
Remove most path-based golangci exclusions ()
They are non-obvious and do not survive refactor.

Will replace with `//nolint` comments after CI results are in.
2023-04-19 22:08:01 -04:00
flynnnnnnnnnn e81ccc406b
Implement FSFE REUSE for golang files ()
Change all license headers to comply with REUSE specification.

Fix 

Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2022-11-27 18:20:29 +00:00
zeripath 3aa5749d53
Disable doctor logging on panic ()
* Disable doctor logging on panic

If permissions are incorrect for writing to the doctor log simply disable the log file
instead of panicing.

Related 

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Update cmd/doctor.go

* Update cmd/doctor.go

Co-authored-by: delvh <dev.lh@web.de>

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2022-08-18 21:27:27 -04:00
zeripath c88547ce71
Add Goroutine stack inspector to admin/monitor ()
Continues on from .

Following the addition of pprof labels we can now more easily understand the relationship between a goroutine and the requests that spawn them. 

This PR takes advantage of the labels and adds a few others, then provides a mechanism for the monitoring page to query the pprof goroutine profile.

The binary profile that results from this profile is immediately piped in to the google library for parsing this and then stack traces are formed for the goroutines.

If the goroutine is within a context or has been created from a goroutine within a process context it will acquire the process description labels for that process. 

The goroutines are mapped with there associate pids and any that do not have an associated pid are placed in a group at the bottom as unbound.

In this way we should be able to more easily examine goroutines that have been stuck.

A manager command `gitea manager processes` is also provided that can export the processes (with or without stacktraces) to the command line.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-03-31 19:01:43 +02:00
zeripath 70628bd870
Add auto logging of goroutine pid label ()
* Add auto logging of goroutine pid label

This PR uses unsafe to export the hidden runtime_getProfLabel function from the
runtime package and then casts the result to a map[string]string.

We can then interrogate this map to get the pid label from the goroutine allowing
us to log it with any logging request.

Reference 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-03-26 20:04:36 +00:00
Gusted ff2fd08228
Simplify parameter types ()
Remove repeated type declarations in function definitions.
2021-12-20 04:41:31 +00:00
zeripath 47dd1cb7ae
Refactor Logger ()
Refactor Logger to make a logger interface and make it possible to
wrap loggers for specific purposes.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-10-31 01:36:46 -04:00