Skip to content

Conversation

wiibaa
Copy link
Collaborator

@wiibaa wiibaa commented Dec 2, 2014

@jordansissel
Copy link
Contributor

Regarding wait_on_restart. Is it desired that the interval of runs be the (time_to_execute + constant_sleep_time) ?

In most of my "run on X interval" uses, I generally want execution to start every X seconds (or similar), which means 'sleep(C)' isn't the solution as it doesn't take into account the execution time of the program.

The 'run every N seconds' problem is discussed and solved here: https://github.com/jordansissel/software-patterns/tree/master/interval-execution/ruby - and Stud::Interval provides a library implementation, if this is what we want.

I only suggest this because for monitoring-style things, you want to run on interval every N seconds (say, running 'uptime' every 10 seconds, or running a health check every minute) that happens nearly-exactly every N seconds, not every N+unknown_exec_time seconds.

Thoughts?

@wiibaa
Copy link
Collaborator Author

wiibaa commented Dec 4, 2014

@jordansissel sorry but I have no strong opinion on this particularly because it is not my usecase. I personally need restart => never because I use pipe occasionally for prototyping and backlog processing, so when the pipe input closes, logstash finish and that's all folks.
Just to recap:

  • Initially pipe input was not restarted
  • #619 was merged as-is for always retry supposing that pipe closing was equivalent to a failure
  • #942 #1385 #1415 and this PR are attempts to restore initial behaviour with configuration...

For me your proposal is more suited for the exec input that does exactly as you described without using Stud::Interval, or if applying it also to pipe it would means that the 2 input could be merged in one with good documentation and examples.

@diije
Copy link

diije commented Aug 3, 2015

Hello,

Any news on this ?
How can I get my pipe not to run multiple times ?

Thanks.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should not be necessary if we add the magic utf-8 header.

@purbon
Copy link

purbon commented Sep 4, 2015

@wiibaa thanks a lot for your contribution, I just left you a very small comment. On the other side, this PR might need a rebase versus master.

@jordansissel Do you think we should get this in ? or reformulate it?

@elasticsearch-release
Copy link

Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'.

@squalou
Copy link

squalou commented Apr 12, 2016

Hi,
any update ?
I've just discoverd the inital pull request from jan 2014 on this topic, would really be a good feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
6 participants