Elffuss BraidHub

kikocis/java-driver public

Revert "Ensure failed reconnection attempts don't re-trigger onDown."

This reverts commit f42f825d5014e3efedd54a77d715f9e696c26856.

This test is a bit fragile and could be harmful if we use unpooled
connections for something other than reconnection attempts in the
future. The only consequence is that onDown might be called multiple
times, which has a negligible impact (notifying the LBP multiple times,
which it's supposed to handle, and rescheduling a reconnection attempt,
which will not start upon encountering another one running).
Changeset45a7e96c0cf9ceedcad113570a71946efe0d52bf1c09e7b1c41e29c1d49f2cf9
Authorolim7t <omichallat+github@gmail.com> · 2014-12-14 18:15 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2014-12-14 18:15 +01:00
Parentsdd058c9e3c8f

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/Connection.java +2 −9
@@ -259,15 +259,8 @@
259259 // sure the "suspected" mechanism work as expected
260260 Host host = factory.manager.metadata.getHost(address);
261261 if (host != null) {
262- // If we get an error on a host that was already DOWN or SUSPECTED, this is a reconnection attempt.
263- // We don't want to signal, because that would invoke triggerOnDown unnecessarily (the host's bad
264- // condition is already taken care of by the reattempt in progress)
265- boolean isReconnectionAttempt = (host.state == Host.State.DOWN || host.state == Host.State.SUSPECT)
266- && !(this instanceof PooledConnection);
267- if (!isReconnectionAttempt) {
268- boolean isDown = factory.manager.signalConnectionFailure(host, ce, host.wasJustAdded(), isInitialized);
269- notifyOwnerWhenDefunct(isDown);
270- }
262+ boolean isDown = factory.manager.signalConnectionFailure(host, ce, host.wasJustAdded(), isInitialized);
263+ notifyOwnerWhenDefunct(isDown);
271264 }
272265
273266 // Force the connection to close to make sure the future completes. Otherwise force() might never get called and