Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry Establishing Connection if it Fails #91

Open
jeromefroe opened this issue Dec 2, 2015 · 3 comments
Open

Retry Establishing Connection if it Fails #91

jeromefroe opened this issue Dec 2, 2015 · 3 comments

Comments

@jeromefroe
Copy link
Contributor

I'm currently using the jdbc plug-in to ingest data from an Oracle database into Elasticsearch every hour on the hour. I've noticed that sometimes the data fails to be ingested and when I check the logstash log file I see an error similar to the one below:

{:timestamp=>"2015-11-28T08:00:00.309000-0500", :message=>"Exception when executing JDBC query", :exception=>#<Sequel::DatabaseDisconnectError: Java::JavaSql::SQLRecoverableException: Closed Connection>, :level=>:warn}

It appears the logstash input failed because of a connection error, and I think it would be helpful to add a retry_count parameter and corresponding functionality so logstash will retry establishing the connection retry_count times. So, for example, if it fails the first time logstash might try again two more times. Thanks!

@dkolli
Copy link

dkolli commented Dec 8, 2015

Hi, I'm using the jdbc plug-in as well and ran into the same issue. hoping the retry_count or connection parameter will kick-in every interval in the schedule.

@rmoff
Copy link

rmoff commented Mar 2, 2016

+1 for this. Here I'm hitting an issue that I want my logstash to start on server boot, but if the source DB isn't up yet it bombs out

The error reported is:
  Java::JavaSql::SQLRecoverableException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

Would be great if there were an option to retry, or not abort on error and just retry at the next schedule invocation.

For the moment I've worked around it by placing this in the line before kicking off logstash. It's not pretty but it basically wait for the listener to be up checking it every 5 seconds.

rc=1;while [ $rc -eq 1 ]; do nc -vz localhost 1521 > /dev/null; rc=$?;echo $rc;sleep 5;done

@jeffbehl
Copy link

jeffbehl commented May 16, 2016

This seems like a bug to me. I don't believe other inputs will cause logstash to exit. "file" certainly doesn't if the file doesn't exist.

EDIT: I think this is actually a similar situation to #76

@untergeek untergeek removed their assignment Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants