xinyuiscool commented on code in PR #1708:
URL: https://github.com/apache/samza/pull/1708#discussion_r1849139326
##########
samza-core/src/main/scala/org/apache/samza/container/TaskInstance.scala:
##########
@@ -312,10 +317,22 @@ class TaskInstance(
val commitStartNs = System.nanoTime()
// first check if there were any unrecoverable errors during the async
stage of the pending commit
- // and if so, shut down the container.
+ // If there is unrecoverable error, increment the metric and the counter.
+ // Shutdown the container in the following scenarios:
+ // 1. skipCommitDuringFailureEnabled is not enabled
+ // 2. skipCommitDuringFailureEnabled is enabled but the number of
exceptions exceeded the max count
+ // Otherwise, ignore the exception.
if (commitException.get() != null) {
- throw new SamzaException("Unrecoverable error during pending commit for
taskName: %s." format taskName,
- commitException.get())
+ metrics.commitExceptions.inc()
+ commitExceptionCounter.incrementAndGet()
+ if (!skipCommitDuringFailureEnabled || commitExceptionCounter.get() >
skipCommitExceptionMaxLimit) {
+ throw new SamzaException("Unrecoverable error during pending commit
for taskName: %s. Exception Counter: %s"
+ format (taskName, commitExceptionCounter.get()),
commitException.get())
+ } else {
+ warn("Ignored the commit failure for taskName %s: %s. Exception
Counter: %s."
+ format (taskName, commitException.get().getMessage,
commitExceptionCounter.get()))
Review Comment:
Can we also print out the stack trace here so we can track the exceptions?
--
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]