Details
-
Bug
-
Resolution: Fixed
-
High
-
1.0
-
None
Description
When HTTP clients disconnect while Stash has already spawned git processes, the git processes are not terminated until they timeout (currently set to 30 minutes).
A bit of debugging uncovered that this is caused by an issue in processutils. When the client disconnects, it triggers an exception when the process tries to write the OutputHandler tries to write to the ServletOutputStream. As a result, the output IO pump finishes, as does the input IO pump. The error stream IO pump however is still running and keeps the process alive.
The git process continues to write to its standard out, until the buffers fill up and the process just blocks. If this happens during a clone request, the process will sit there and hold on to 100s of MBs of memory for 30 minutes..