diff options
author | Jo Kristian Bergum <bergum@oath.com> | 2019-08-09 12:53:43 +0200 |
---|---|---|
committer | Jo Kristian Bergum <bergum@oath.com> | 2019-08-09 12:53:43 +0200 |
commit | 3cb577ccadced2c9537fdb3aeff3df3f681868e1 (patch) | |
tree | 2dbf833ec89758882bfdd8c2d226f218ce7798be /vespa-http-client | |
parent | e1b3b702c124448160d775399afcef9823b66357 (diff) |
Improve log messages and include response code
Diffstat (limited to 'vespa-http-client')
-rw-r--r-- | vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/IOThread.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/IOThread.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/IOThread.java index 8ec4f6cb7f4..44e988f6d7d 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/IOThread.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/IOThread.java @@ -303,14 +303,16 @@ class IOThread implements Runnable, AutoCloseable { case DISCONNECTED: try { if (! client.connect()) { - log.log(Level.WARNING, "Connect returned null " + endpoint); + log.log(Level.WARNING, "Could not connect to endpoint: '" + endpoint + "'. Will re-try."); drainFirstDocumentsInQueueIfOld(); return ThreadState.DISCONNECTED; } return ThreadState.CONNECTED; } catch (Throwable throwable1) { drainFirstDocumentsInQueueIfOld(); - log.log(Level.INFO, "Connect did not work out " + endpoint, throwable1); + + log.log(Level.INFO, "Failed connecting to endpoint: '" + endpoint + + "'. Will re-try connecting. Failed with '" + Exceptions.toMessageString(throwable1) + "'",throwable1); executeProblemsCounter.incrementAndGet(); return ThreadState.DISCONNECTED; } @@ -319,15 +321,19 @@ class IOThread implements Runnable, AutoCloseable { client.handshake(); successfulHandshakes.getAndIncrement(); } catch (ServerResponseException ser) { + executeProblemsCounter.incrementAndGet(); - log.info("Handshake did not work out " + endpoint + ": " + Exceptions.toMessageString(ser)); + log.log(Level.INFO, "Failed talking to endpoint. Handshake with server endpoint '" + endpoint + + "' failed. Will re-try handshake. Failed with '" + Exceptions.toMessageString(ser) + "'",ser); + drainFirstDocumentsInQueueIfOld(); resultQueue.onEndpointError(new FeedProtocolException(ser.getResponseCode(), ser.getResponseString(), ser, endpoint)); return ThreadState.CONNECTED; } catch (Throwable throwable) { // This cover IOException as well executeProblemsCounter.incrementAndGet(); resultQueue.onEndpointError(new FeedConnectException(throwable, endpoint)); - log.info("Problem with Handshake " + endpoint + ": " + Exceptions.toMessageString(throwable)); + log.log(Level.INFO, "Failed talking to endpoint. Handshake with server endpoint '" + endpoint + + "' failed. Will re-try handshake. Failed with '" + Exceptions.toMessageString(throwable) + "'",throwable); drainFirstDocumentsInQueueIfOld(); client.close(); return ThreadState.DISCONNECTED; @@ -339,11 +345,14 @@ class IOThread implements Runnable, AutoCloseable { gatewayThrottler.handleCall(processResponse.transitiveErrorCount); } catch (ServerResponseException ser) { - log.info("Problems while handing data over to gateway " + endpoint + ": " + Exceptions.toMessageString(ser)); + log.log(Level.INFO, "Problems while handing data over to endpoint '" + endpoint + + "'. Will re-try. Endpoint responded with a HTTP response code we did not expect. '" + + Exceptions.toMessageString(ser) + "'",ser); return ThreadState.CONNECTED; } catch (Throwable e) { // Covers IOException as well - log.info("Problems while handing data over to gateway " + endpoint + ": " + Exceptions.toMessageString(e)); + log.log(Level.INFO, "Problems while handing data over to endpoint '" + endpoint + + "'. Will re-try. Connection level error. Failed with '" + Exceptions.toMessageString(e) + "'", e); client.close(); return ThreadState.DISCONNECTED; } |