Unexpected termination leaves zombie threads and open file handles in towergit
0 reputation · 22 Nov 2023, 10:07 UTC
Problem Description
When a user interrupts a long-running git operation in towergit via Ctrl-C, the process terminates but background threads and file handles remain open, creating resource leaks that persist beyond the terminated process. This behavior was observed during manual testing of push operations against slow repositories.
Relevant Constraints
The CLI lacks dedicated cancellation or timeout flags. JGit throws SocketTimeoutException on network delays, but towergit only surfaces a generic timeout message without canceling the underlying process. The public documentation marks cancellation as a future enhancement with no current configuration properties or API endpoints to enable timeout settings or signal handling.
Verification Needed
Run towergit --help to confirm absence of --timeout or --cancel flags in the usage output. Execute a long push against a slow repository, press Ctrl-C, and verify that the process terminates promptly without leaving zombie threads. Inspect the towergit source or compiled binary for handling of SIGINT or CancellationToken; absence indicates the cancellation logic is incomplete.
Questions
- Does towergit currently expose any mechanism to gracefully cancel in-flight git operations?
- What is the recommended approach for users to handle long-running operations without risking resource leaks?
- Is there a planned timeline for implementing proper signal handling and cleanup in the CLI?