kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 597fa42e6e241cef065ff5444205af537f21bc780594c3b0123b0c36fa0a98c1 |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2014-09-17 18:26 -07:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2014-09-23 11:35 +02:00 |
| Parents | 46e39b8b4a39 |
2 files changed
modified driver-core/CHANGELOG.rst +1 −0
| @@ -7,6 +7,7 @@ | ||
| 7 | 7 | - [bug] Handle null pool in PooledConnection.release (JAVA-449) |
| 8 | 8 | - [bug] Prevent concurrent retries of the same query (JAVA-449) |
| 9 | 9 | - [improvement] Defunct connection on request timeout (JAVA-425) |
| 10 | +- [improvement] Try next host when we get a SERVER_ERROR (JAVA-426) | |
| 10 | 11 | |
| 11 | 12 | |
| 12 | 13 | 2.0.6: |
modified driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java +10 −0
| @@ -349,6 +349,16 @@ | ||
| 349 | 349 | metrics().getErrorMetrics().getOthers().inc(); |
| 350 | 350 | retry(false, null); |
| 351 | 351 | return; |
| 352 | + case SERVER_ERROR: | |
| 353 | + // Defunct connection and try another node | |
| 354 | + logger.warn("{} replied with server error ({}), trying next host.", connection.address, err.message); | |
| 355 | + DriverException exception = new DriverException("Host replied with server error: " + err.message); | |
| 356 | + logError(connection.address, exception); | |
| 357 | + connection.defunct(exception); | |
| 358 | + if (metricsEnabled()) | |
| 359 | + metrics().getErrorMetrics().getOthers().inc(); | |
| 360 | + retry(false, null); | |
| 361 | + return; | |
| 352 | 362 | case IS_BOOTSTRAPPING: |
| 353 | 363 | // Try another node |
| 354 | 364 | logger.error("Query sent to {} but it is bootstrapping. This shouldn't happen but trying next host.", connection.address); |