You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by "abhishekmjain (via GitHub)" <gi...@apache.org> on 2025/07/28 04:09:41 UTC
Re: [PR] [GOBBLIN-2210] Wrap temporal heartbeat runnable [gobblin]
abhishekmjain commented on code in PR #4119:
URL: https://github.com/apache/gobblin/pull/4119#discussion_r2234616990
##########
gobblin-utility/src/main/java/org/apache/gobblin/util/ExecutorsUtils.java:
##########
@@ -162,6 +165,27 @@ public static Runnable loggingDecorator(Runnable runnable) {
return new MDCPropagatingRunnable(runnable);
}
+
+ /**
+ * Wraps a {@link Runnable} task with exception handling to ensure that
+ * any thrown exception does not terminate the thread or scheduled executor.
+ * This is useful for long-running or recurring tasks where resilience is critical.
+ *
+ * @param runnable the task to wrap
+ * @return a safe {@link Runnable} that logs and suppresses exceptions
+ */
+ public static Runnable safeRunnable(Runnable runnable) {
Review Comment:
nit: Let's rename this to executeRunnableSafely to give an indication that we are calling run
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org