allthingssecurity commented on code in PR #27919:
URL: https://github.com/apache/camel/pull/27919#discussion_r4292683246
##########
components/camel-docker/src/main/java/org/apache/camel/component/docker/consumer/DockerEventsConsumer.java:
##########
@@ -96,5 +221,55 @@ public void onNext(Event event) {
AsyncCallback cb = defaultConsumerCallback(exchange, true);
getAsyncProcessor().process(exchange, cb);
}
+
+ @Override
+ public void onError(Throwable throwable) {
+ if (closed) {
+ // closed by the consumer, which makes the read of the stream
fail
+ return;
+ }
+ // not super.onError(), which logs an ERROR with the stack trace
for every failed attempt
+ closeQuietly();
+ if (callback != this || !isRunAllowed()) {
+ return;
+ }
+ long delay = open ? SUBSCRIBE_AGAIN_DELAY_MILLIS : retryDelay;
+ if (open) {
Review Comment:
Intentional, but you are right that the stack trace is then lost entirely.
When the stream was open, its failure is logged once at WARN with the stack
trace. When it never opened (the daemon is down), every retry would otherwise
log a full stack trace, so that WARN is one line. For consistency with the
`subscribeAgain` catch, it would be better to also log the throwable at DEBUG
there. I can add that in the same small follow-up as the test above.
_Claude Code on behalf of allthingssecurity_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]