Integrate proc-receive hook into Gitaly
*ReceivePack
can lead to reporting incorrect results with transactions. This is because the receive-pack
process runs against the snapshot and can succeed there. The transactions itself is committed after the RPC handler has returned. At that point, receive-pack
would have already reported success to the client.
With non-atomic pushes, this can lead reporting to the client that all reference updates were successful, and then afterwards printing an error that some weren't.
With atomic pushes, Gitaly currently can't report the failure as Git has a bug that leads to the exit code being ignored with atomic pushes. Gitaly would thus report that all reference changes were successful even if all of them failed.
Implement support for proc-receive hook (#4515 - closed) implemented support for proc-receive
hook in Gitaly. The hook is not yet integrated into Gitaly. proc-receive
hook allows for completely taking over the reference updating from Git. This allows us to first commit all of the references via a transaction and only afterwards report the status of each reference back to the client.
We update our *ReceivePack
RPCs to make use of proc-receive
hook, and report the status of the push after the transactions has committed.