dbmate
dbmate copied to clipboard
dbmate should roll the transaction back on sigint
I think today there is a shutdown race that sometimes causes a rollback, but to make it consistent I think we need a signal handler in here: https://github.com/amacneil/dbmate/blob/master/pkg/dbmate/db.go#L188,L203
How about the first sigint triggers the rollback (and subsequent exit), and the second one does an immediate exit?
https://github.com/amacneil/dbmate/issues/99 would change the location of the signal handler
Sounds good. I like the behavior of graceful shutdown on first signal and hard exit on second.
We should probably handle SIGTERM the same way, I don't know what our current behavior is.