salesforce / p4-fusion

A fast Perforce to Git conversion tool written in C++ using Perforce Helix Core C++ API and Libgit2
BSD 3-Clause "New" or "Revised" License
78 stars 15 forks source link

Handle `SIG_KILL` to gracefully exit when the host receives a shutdown signal #40

Closed twarit-waikar closed 2 years ago

twarit-waikar commented 2 years ago

This looks like something that might have caused issues but surprisingly hasn’t so far, which means p4-fusion is not corrupting the repo even if it gets interrupted. However, we should be on the safe side and also add the graceful exit handler for SIG_KILL in addition to SIG_INT (SIG_INT handler is already implemented)

twarit-waikar commented 2 years ago

SIGKILL is not a signal that applications get a chance to handle in *nix OSs, but we can add a SIGTERM handler along with the existing SIGINT handler.