简体   繁体   English

Google数据流:设置一个DefaultUncaughtExceptionHandler

[英]Google Dataflow: set a DefaultUncaughtExceptionHandler

Is it possible to set a DefaultUncaughtExceptionHandler for every worker and thread in Dataflow ? 是否可以为DefaultUncaughtExceptionHandler中的每个工作程序和线程设置DefaultUncaughtExceptionHandler

Something like Thread.setDefaultUncaughtExceptionHandler . Thread.setDefaultUncaughtExceptionHandler之类的东西。

No, I don't believe so. 不,我不相信。 The Dataflow model for expressing user code operates at a higher level of abstraction than individual workers and threads. 用于表达用户代码的数据流模型在抽象级别上的运行高于单个工作线程和线程。 Can you expand a bit more on why you'd like to do this globally? 您能否进一步说明为什么要在全球范围内这样做?

The Dataflow Service already retries all uncaught exceptions in your user code. 数据流服务已重试用户代码中所有未捕获的异常。 Elements are processed in groups called bundles -- if any element in a bundle causes an exception to be thrown, the entire bundle is retried. 元素在称为捆绑的组中进行处理-如果捆绑中的任何元素导致引发异常,则重试整个捆绑。 In batch mode, failing bundles are retried until a single bundle has failed 4 times, at which point the job is failed. 在批处理模式下,重试失败的捆绑包,直到单个捆绑包失败4次为止,此时作业失败。 In streaming mode, failing bundles are retried indefinitely, although you can use the update feature to update your code to better handle the issue. 在流模式下,尽管可以使用更新功能来更新代码以更好地解决问题,但可以无限期重试失败的捆绑软件。

All of these exceptions will appear in both the job logs in Dataflow UI and in your Cloud Logging worker logs. 所有这些异常都将同时出现在Dataflow UI的作业日志和Cloud Logging工作日志中。 See more info here . 在此处查看更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM