Hello everyone, what would be the correct way to p...
# singer-tap-development
l
Hello everyone, what would be the correct way to programmatically interrupt a
tap|target
run? by correct, I mean that the tap should stop fetching data immediately (ideally waiting for the requests that were caught mid-flight), the target should flush whatever it has received so far, and update bookmarks so that upon next restart, there's no way to know the previous run was interrupted. I've tried sending
SIGTERM
to the tap, but it didn't seem to work, the tap exited, and the target just sat there waiting. I'm running those outside meltano. Is this even supported by the
sdk
?
v
I know Meltano will pass the signals down to the tap/targets for you, so in the tap sigterm case Meltano would tell the target to wrap up as well with a signal as it'd detect process 1 finished (At least that's how I'd imagine it'd work right now, I've definitely had my tap die for a lot of reasons and I think even sigterm'd and the target's stopped but I"m not 100% sure of all the details). The sdk should definietly handle signals being sent to the tap/target and allow for different things. Not sure if it does hmm!
a
@laurent - I think we logged an issue a while back to gracefully handle
SIGTERM
but to my knowledge it hasn't been added yet.
cc @edgar_ramirez_mondragon
If the tap responded by ceasing at the next safe chance, along with sending the latest
STATE
and then close down, then presumably the target would see those to completion and you'd have a decent resume possibility from there.
e
Yeah, the SDK needs to handle the signal to send the state message before it terminates. There’s no sigterm or keyboard interrupt handling in the tap
l
Thanks for your feedback. I found this issue https://github.com/meltano/sdk/issues/129, just for the record. We run taps with a long-running scheduler process, every deploy (and a few other events) causes everything to crash, which I think leads to a lot of duplicated API calls (and the github ones are pretty limited).