Skip to content

Make Requests Processes and create process hierarchy. Associate OpenRepository with context. #17125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 46 commits into from
Nov 30, 2021
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3a7e682
Move process to create contexts
zeripath Sep 18, 2021
47bda44
display children processes
zeripath Sep 18, 2021
cd16cbb
Make requests a process
zeripath Sep 18, 2021
12039b9
Add context to repo and add ctx to OpenRepository
zeripath Sep 18, 2021
d2b01e4
minor comments
zeripath Sep 22, 2021
659fcf6
Merge remote-tracking branch 'origin/main' into request-as-process
zeripath Sep 23, 2021
9598eca
fix lint and children lock
zeripath Sep 23, 2021
3344e26
Merge remote-tracking branch 'origin/main' into request-as-process
zeripath Oct 10, 2021
7cf7749
separate remove and cancel functions
zeripath Oct 10, 2021
a8e228e
associate repo functions with the repo context
zeripath Oct 10, 2021
08b77d1
fix lint
zeripath Oct 13, 2021
47b0614
Merge remote-tracking branch 'origin/main' into request-as-process
zeripath Oct 13, 2021
518b79e
Merge remote-tracking branch 'origin/main' into request-as-process
zeripath Oct 15, 2021
9bb820b
Simplify PID to strings using the time of start plus/minus a counter
zeripath Oct 15, 2021
9895680
extract process out of manager.go
zeripath Oct 15, 2021
afc5b41
fix test
zeripath Oct 15, 2021
7446c87
Merge remote-tracking branch 'origin/main' into request-as-process
zeripath Oct 15, 2021
86ab980
Merge branch 'main' into request-as-process
zeripath Oct 17, 2021
4ce4614
Make the Mirror Queue a queue (#17326)
zeripath Oct 17, 2021
633b041
make mirroring a process
zeripath Oct 17, 2021
377a384
Ensure that mirrors are al within the same context
zeripath Oct 17, 2021
32c58ee
Merge remote-tracking branch 'origin/main' into request-as-process
zeripath Oct 17, 2021
71dec99
add clarity to the difference between cancel and remove
zeripath Oct 19, 2021
9e95fdb
add explanatory notes for remove and close
zeripath Oct 19, 2021
3010f59
Merge remote-tracking branch 'origin/main' into request-as-process
zeripath Oct 19, 2021
9cc97d0
explicitly name the arguments in the blame reader
zeripath Oct 19, 2021
e4aebfb
Change remove to finished
zeripath Oct 20, 2021
217fbf7
update blame documentation
zeripath Oct 20, 2021
6b6ac80
as per review
zeripath Oct 20, 2021
0fcbc38
Merge remote-tracking branch 'origin/main' into request-as-process
zeripath Oct 27, 2021
e06216b
Close the cat-file batch and checks after the context cancellation
zeripath Oct 27, 2021
2062e43
Merge remote-tracking branch 'origin/main' into request-as-process
zeripath Oct 28, 2021
46c2b7a
Merge branch 'main' into request-as-process
zeripath Nov 1, 2021
37bfa14
Merge branch 'main' into request-as-process
zeripath Nov 5, 2021
ad2e278
Merge remote-tracking branch 'origin/main' into request-as-process
zeripath Nov 16, 2021
6062b04
Merge remote-tracking branch 'origin/main' into request-as-process
zeripath Nov 20, 2021
59dc919
Merge remote-tracking branch 'origin/main' into request-as-process
zeripath Nov 26, 2021
347e6a8
Merge branch 'main' into request-as-process
lafriks Nov 28, 2021
fd86412
Merge branch 'main' into request-as-process
lunny Nov 28, 2021
0d1ae72
Merge remote-tracking branch 'origin/main' into request-as-process
zeripath Nov 28, 2021
1d565bb
Merge branch 'main' into request-as-process
zeripath Nov 29, 2021
bbe69c8
Merge branch 'main' into request-as-process
zeripath Nov 30, 2021
1203fa9
Ensure that http requests use the same context as the request
zeripath Nov 30, 2021
772d31d
use the repo context in the diff
zeripath Nov 30, 2021
37f0716
improve code documentation
zeripath Nov 30, 2021
ec6b663
use the gitrepo context
zeripath Nov 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make requests a process
Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed Sep 22, 2021
commit cd16cbbfc724f5f946055c565e7af128ddc5325d
5 changes: 4 additions & 1 deletion routers/common/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/process"
"code.gitea.io/gitea/modules/setting"

"github.com/chi-middleware/proxy"
Expand All @@ -22,7 +23,9 @@ func Middlewares() []func(http.Handler) http.Handler {
var handlers = []func(http.Handler) http.Handler{
func(next http.Handler) http.Handler {
return http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
next.ServeHTTP(context.NewResponse(resp), req)
ctx, cancel := process.GetManager().AddContext(req.Context(), fmt.Sprintf("%s: %s", req.Method, req.RequestURI))
defer cancel()
next.ServeHTTP(context.NewResponse(resp), req.WithContext(ctx))
})
},
}
Expand Down