Skip to content
Snippets Groups Projects

gitpipe: Prioritize context cancellation

Merged Patrick Steinhardt requested to merge pks-gitpipe-cancellation into master
All threads resolved!

We're observing flaky tests in our gitpipe code, where the race happens on context cancellation: we'll either see that the pipeline has shut down gracefully, or alternatively we'll see that git-rev-list(1) was killed because of context cancellation. This race can happen because we don't prioritize handling of context cancellations: if git-rev-list(1) was killed via the context, then it must've happened via our context and thus we know that at the point of sending the error down the pipeline, that the context has terminated already.

Fix the race by prioritizing context cancellation: before trying to send down any results or errors, we'll first check whether the context was cancelled. This also allows us to get rid of the workaround we had in our pipeline tests where there was a special child context such that we didn't observe killed git-cat-file(1) processes.

Fixes #3697 (closed), #3693 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Christian Couder approved this merge request

    approved this merge request

  • Christian Couder resolved all threads

    resolved all threads

  • mentioned in commit 5fdd1ba6

  • added workflowcanary label and removed workflowstaging label

  • added workflowproduction label and removed workflowcanary label

  • Due to an issue the workflowstaging-ref label was incorrectly applied to this merge request. Re-setting back to workflowproduction using https://gitlab.com/gitlab-org/release-tools/-/merge_requests/1620

  • Please register or sign in to reply
    Loading