Skip to content

Commit

Permalink
Increase processing timeout (#40)
Browse files Browse the repository at this point in the history
Calculating diffs on promotion pull requests like [1] fails since the
context is timing out and processing is aborted. This is evident from
logs.

    Error getting manifests for app ..., revision ...:
	rpc error: code = DeadlineExceeded desc = context deadline exceeded"
    Error generating diff for component ...:
	rpc error: code = DeadlineExceeded desc = context deadline exceeded"
    Handling of PR event failed: err=getting diff information:
	rpc error: code = DeadlineExceeded desc = context deadline exceeded\n" ...

Increasing the timeout is a short-term fix to mitigate the issue and
allow users to get the diff while additional investigation is done to
figure out how we can address this better long-term.

[1] commercetools/k8s-gitops#998
  • Loading branch information
hnnsgstfssn authored Oct 30, 2024
1 parent deb0692 commit 232cc52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/pkg/githubapi/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func ReciveWebhook(r *http.Request, mainGhClientCache *lru.Cache[string, GhClien
func handleEvent(eventPayloadInterface interface{}, mainGhClientCache *lru.Cache[string, GhClientPair], prApproverGhClientCache *lru.Cache[string, GhClientPair], r *http.Request, payload []byte) {
// We don't use the request context as it might have a short deadline and we don't want to stop event handling based on that
// But we do want to stop the event handling after a certain point, so:
ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
var mainGithubClientPair GhClientPair
var approverGithubClientPair GhClientPair
Expand Down

0 comments on commit 232cc52

Please sign in to comment.