Skip to content

gitpipe: Fix deadlock on context cancellation with unflushed requests

In commit 8773480f (gitpipe: Propagate context cancellation in object data pipeline, 2022-05-04), we have fixed an error that cancellation of the context wasn't properly propagated to callers. While fixing this we have introduced a new deadlock though: when the context is cancelled, we may abort the pipeline early without flushing outstanding requests. This means that the downstream reader which tries to read object data from the git-cat-file(1) process is blocked indefinitely in case the process is cached given that it wouldn't be killed by the context cancellation.

Fix this deadlock by flushing any outstanding requests when the context is cancelled.

Changelog: fixed

Fixes #4253 (closed)

Edited by Patrick Steinhardt

Merge request reports