Hey guys,

TL;DR any way to properly emulate LogStreamerInput behavior in Lua with a
SandboxInput ?

i'm having trouble trying to write a SandboxInput and since the docs aren't
the most helpful regarding that (no examples) - i thought i will ask here.

Any directions/pointers for making a SandboxInput that would continuously
listen for new entries in a file? The reason why i'm not using a
LogStreamerInput input with a SandboxDecoder is that i need to use the Lua
'io' module, and it's not available for SandboxDecoders only for
SandboxInputs.

The problems i'm having so far is:
* if the input does not have a "ticker_interval" set and process_message()
finishes - i get a "single run completed" entry in the log and the input
never restarts

* i tried using os.execute('sleep 1') / io.popen('sleep 1') after the input
is exhausted to wait for a bit and then recheck if there is any new input,
but:
os.execute('sleep 1') works for sleeping and listening for new input, but
stopping heka (Ctrl+C) does not work
io.popen('sleep 1') also works for sleeping and listening for new input,
but when trying to stop heka (Ctrl+C) on first Ctrl+C you get log entries
"Shutdown initiated.", "Stop message sent to input '<your_input>'" but it
does not shutdown (is there some way to handle the "stop message" in the
SandboxInput??) and on some subsequent Ctrl+C it enters the infinte restart
loop (read below)

* if the input has a "ticker_interval" - it either also never restarts or
restarts when you try to exit heka and enters a weird infinite loop state,
where it looks be infinitely restarting, heka is at 100% cpu and you have
to "kill -9" it to stop it. I think the infinite restart is caused by the
input crashing for some reason and then my global input file position
tracking is not updated and the input is restarted and so it is processing
the same input again and again. This behavior depends on the set
"ticker_interval", but i don't understand how those values work, e.g.:
ticker_interval = 1000 : infinite restarting
ticker_interval = 1000000000 : infinite restarting
ticker_interval = 10000000000 : "single run completed" and never restarts
ticker_interval = 100000000000 : infinite restarting
This looks like some weird race conditions going on or smth..

I tried heka versions 0.9.2 and 0.10.0b1 and i'm getting the same results
on both.

Any way to properly emulate LogStreamerInput behavior in Lua with a
SandboxInput ?
_______________________________________________
Heka mailing list
[email protected]
https://mail.mozilla.org/listinfo/heka

Reply via email to