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

Logstash does not reconnect when Sybase raises "Connection is already closed" #163

Open
kaisecheng opened this issue May 3, 2024 · 1 comment
Assignees

Comments

@kaisecheng
Copy link
Contributor

kaisecheng commented May 3, 2024

Similar issue to #143 , #152 , this time is Sybase. The upstream Sequel driver is affected by a connection issue as described in jeremyevans/sequel#2159 Sequel lib doesn't support Sybase, hence, the plugin needs special handling for Sybase to solve this issue.

def DB.disconnect_error?(exception, opts)
  super || exception.message =~ /Connection is already closed\.\z/
end

This problem is caused when a connection gets closed by Sybase (idle sessions, workload rules, network issues, etc.)
Logstash should gracefully recover from those errors, discarding the stale connection and reconnecting the client. Instead, the plugin hangs trying to reuse the closed/invalid connections.

@kaisecheng kaisecheng added bug Something isn't working status:needs-triage labels May 3, 2024
@roaksoax roaksoax changed the title Logstash does not reconnect when Sybase raises "Connection is already closed" Update Sequel driver (once release upstream) to fix Sybase raises "Connection is already closed" May 3, 2024
@roaksoax roaksoax removed bug Something isn't working status:needs-triage labels May 3, 2024
@kaisecheng kaisecheng changed the title Update Sequel driver (once release upstream) to fix Sybase raises "Connection is already closed" Logstash does not reconnect when Sybase raises "Connection is already closed" May 7, 2024
@kaisecheng
Copy link
Contributor Author

A workaround is enabling jdbc_validate_connection and set the jdbc_validation_timeout to a smaller interval value compared to the schedule option

for example a scheduler runs for every minute, jdbc_validation_timeout should be smaller than 60 seconds.

schedule => "* * * * *"
jdbc_validate_connection => true
jdbc_validation_timeout => 55 # 55 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants