nileshkumar3 commented on code in PR #22035:
URL: https://github.com/apache/kafka/pull/22035#discussion_r3456308960
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkThread.java:
##########
@@ -179,6 +181,31 @@ private void maybeSetInitializationError(KafkaException
error) {
log.error("Consumer network thread resource initialization error ({})
will be suppressed as an error was already set", error.getMessage(), error);
}
+ private void maybeSetFatalError(Throwable error) {
+ if (fatalError.compareAndSet(null, error))
+ return;
+
+ log.error("Consumer network thread fatal error ({}) will be suppressed
as an error was already set", error.getMessage(), error);
+ }
+
+ /**
+ * Returns the error that caused the network thread to terminate, if any.
This may be a runtime
+ * failure ({@link #fatalError}) or an initialization failure ({@link
#initializationError}).
+ * The thread object remains accessible after the thread has exited, so
the application thread
+ * can retrieve this when subsequent API calls detect the thread is no
longer alive.
+ */
+ public Optional<Throwable> terminationError() {
Review Comment:
Removed terminationError() along with the fatalError field and
maybeSetFatalError().
--
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]