Timeout for Dropwizard's health checks?

376 views
Skip to first unread message

Pablo Compagni

unread,
Feb 25, 2015, 11:12:09 AM2/25/15
to dropwiz...@googlegroups.com
Hi,

I have two sql database connections for which health checks are automatically added by dropwizard. But when the application loses connection to one of them, the /healthcheck endpoint takes indefinitely long to respond, where I would want it to timeout after a few seconds.

I've already set the maxWaitForConnection setting, and I've also experimented with the various checkConnectionOn.. settings, but nothing helped.

The health check correctly fails if the server actively refuses the connection, but it hangs indefinitely if it's not the case, for instance, a network issue.

Is it possible to have sql health checks timeout at a specified time value whatever the problem is?


Thanks, 

Pablo.

Ryan Kennedy

unread,
Feb 25, 2015, 12:26:05 PM2/25/15
to dropwiz...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dropwizard-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pablo Compagni

unread,
Feb 25, 2015, 4:17:11 PM2/25/15
to dropwiz...@googlegroups.com
Both DBI, 1 Sql Server and 1 MySql, could this be related to the drivers?

CAB

unread,
Mar 5, 2015, 2:35:07 PM3/5/15
to dropwiz...@googlegroups.com
I took a crack at it: https://github.com/dropwizard/dropwizard/pull/921

If it gets approved, we can do the same for hibernate.

Paul Brown

unread,
Mar 5, 2015, 4:11:17 PM3/5/15
to dropwiz...@googlegroups.com

I've done a once-over and wonder if the pool already provides enough to go on?  See https://github.com/dropwizard/dropwizard/pull/921#discussion_r25901568; note that this suggestion would supplant the old, timeout-less DBIHealthCheck entirely.
Reply all
Reply to author
Forward
0 new messages