embulk-output-bigquery
embulk-output-bigquery copied to clipboard
Temporary files at local disk should be deleted when embulk job is aborted
trafficstars
When I abort embulk job with Ctrl+C, temporary files at local disk wasn't removed. I think we should imprement content of abort() at embulk-output-bigquery/lib/embulk/output/bigquery.rb L525 or https://github.com/embulk/embulk-output-bigquery/blob/master/lib/embulk/output/bigquery.rb#L423
MEMO: embulk itself does not have any plugin hook points to be called on signal handler. Writing something indef abort or else does not work.
To handle Ctrl-C, Runtime.addShutdownHook() can be used in Java. In the case of JRuby, it becomes like https://gist.github.com/hiremaga/320008.
Of course, we should not catch signal in our plugin because it breaks entire Java work load.