Commit Graph
3 Commits
Author SHA1 Message Date
flynnnnnnnnnn e81ccc406b Implement FSFE REUSE for golang files (#21840)
Change all license headers to comply with REUSE specification.

Fix #16132

Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github>
Co-authored-by: John Olheiser <[email protected]>
2022-11-27 18:20:29 +00:00
zeripath c88547ce71 Add Goroutine stack inspector to admin/monitor (#19207)
Continues on from #19202.

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 <[email protected]>
2022-03-31 19:01:43 +02:00
zeripath a82fd98d53 Pause queues (#15928)
* Start adding mechanism to return unhandled data

Signed-off-by: Andrew Thornton <[email protected]>

* Create pushback interface

Signed-off-by: Andrew Thornton <[email protected]>

* Add Pausable interface to WorkerPool and Manager

Signed-off-by: Andrew Thornton <[email protected]>

* Implement Pausable and PushBack for the bytefifos

Signed-off-by: Andrew Thornton <[email protected]>

* Implement Pausable and Pushback for ChannelQueues and ChannelUniqueQueues

Signed-off-by: Andrew Thornton <[email protected]>

* Wire in UI for pausing

Signed-off-by: Andrew Thornton <[email protected]>

* add testcases and fix a few issues

Signed-off-by: Andrew Thornton <[email protected]>

* fix build

Signed-off-by: Andrew Thornton <[email protected]>

* prevent "race" in the test

Signed-off-by: Andrew Thornton <[email protected]>

* fix jsoniter mismerge

Signed-off-by: Andrew Thornton <[email protected]>

* fix conflicts

Signed-off-by: Andrew Thornton <[email protected]>

* fix format

Signed-off-by: Andrew Thornton <[email protected]>

* Add warnings for no worker configurations and prevent data-loss with redis/levelqueue

Signed-off-by: Andrew Thornton <[email protected]>

* Use StopTimer

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
2022-01-22 21:22:14 +00:00