Skip to content

Commit 081bb4c

Browse files
authored
Log failure in internalSend (#131418) (#131600)
An exception here should be impossible, but we don't assert that, nor do we emit a log message to prove it didn't happen in a production environment. This commit adds the missing log and assert.
1 parent c1e42d8 commit 081bb4c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

server/src/main/java/org/elasticsearch/transport/OutboundHandler.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,16 @@ private void maybeLogSlowMessage(boolean success) {
433433
}
434434
});
435435
} catch (RuntimeException ex) {
436+
logger.error(
437+
Strings.format(
438+
"unexpected exception calling sendMessage for transport message [%s] of size [%d] on [%s]",
439+
messageDescription.get(),
440+
messageSize,
441+
channel
442+
),
443+
ex
444+
);
445+
assert Thread.currentThread().getName().startsWith("TEST-") : ex;
436446
channel.setCloseException(ex);
437447
Releasables.closeExpectNoException(() -> listener.onFailure(ex), () -> CloseableChannel.closeChannel(channel));
438448
throw ex;

0 commit comments

Comments
 (0)