beam icon indicating copy to clipboard operation
beam copied to clipboard

Stack trace decoration with Operator name for Samza Runner

Open Sanil15 opened this issue 2 years ago • 2 comments

  • Added support for displaying the full tranform name with any stack-trace for Samza Runner
  • Added support for decorating stack traces with additional debugging information by adding a SamzaExceptionListener via the observer pattern

Full transform name will be displayed with stack-trace on any exception thrown at runtime for ex

2022-08-02 11:45:30 ERROR [OpAdapter] [Samza StreamProcessor Container Thread-0] Op My Custom Operator/ParMultiDo(Anonymous) threw an exception during processing
java.lang.RuntimeException: org.apache.beam.sdk.util.UserCodeException: java.lang.RuntimeException: My Custom Exception
	at org.apache.beam.runners.samza.metrics.DoFnRunnerWithMetrics.withMetrics(DoFnRunnerWithMetrics.java:96) ~[beam-runners-samza-200.30.0.5.jar:?]
	at org.apache.beam.runners.samza.metrics.DoFnRunnerWithMetrics.processElement(DoFnRunnerWithMetrics.java:53) ~[beam-runners-samza-200.30.0.5.jar:?]
	at org.apache.beam.runners.core.SimplePushbackSideInputDoFnRunner.processElementInReadyWindows(SimplePushbackSideInputDoFnRunner.java:79) ~[beam-runners-core-java-200.30.0.5.jar:?]
	at org.apache.beam.runners.samza.runtime.DoFnOp.processElement(DoFnOp.java:295) ~[beam-runners-samza-200.30.0.5.jar:?]
	at org.apache.beam.runners.samza.runtime.OpAdapter.apply(OpAdapter.java:94) ~[beam-runners-samza-200.30.0.5.jar:?]

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • [ ] Choose reviewer(s) and mention them in a comment (R: @username).
  • [ ] Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • [ ] Update CHANGES.md with noteworthy changes.
  • [ ] If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels Python tests Java tests Go tests

See CI.md for more information about GitHub Actions CI.

Sanil15 avatar Aug 03 '22 18:08 Sanil15

R: @xinyuiscool @kw2542

Sanil15 avatar Aug 03 '22 18:08 Sanil15

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

github-actions[bot] avatar Aug 03 '22 18:08 github-actions[bot]

Run Samza ValidatesRunner

kw2542 avatar Aug 12 '22 18:08 kw2542

Run Java Samza PortableValidatesRunner

kw2542 avatar Aug 12 '22 18:08 kw2542

Run Python Samza ValidatesRunner

kw2542 avatar Aug 12 '22 18:08 kw2542

Run XVR_Samza PostCommit

kw2542 avatar Aug 12 '22 18:08 kw2542

Run Go Samza ValidatesRunner

kw2542 avatar Aug 12 '22 18:08 kw2542

Discussed offline and found out the actual use cases is for full TransformName. Suggest encoding that in the OpAdapter layer instead of pushing down to each Op and then only used by OpAdaptor.

xinyuiscool avatar Aug 17 '22 18:08 xinyuiscool

Discussed offline and found out the actual use cases is for full TransformName. Suggest encoding that in the OpAdapter layer instead of pushing down to each Op and then only used by OpAdaptor.

ack, similplied the transform name via encoding it in OpAdapter

Sanil15 avatar Aug 22 '22 17:08 Sanil15

We found some unmerged changes from linkedin/beam to apache/beam, those changes needs to be first merged to open source to do this PR. For instance still in open source PortableTranslationContext & TranslationContext do not have a lineage

https://github.com/apache/beam/blob/0474afbe608cc6e43f8acc3464005e98c8ff4555/runners/samza/src/main/java/org/apache/beam/runners/samza/translation/PortableTranslationContext.java#L51

but for Linkedin fork does

https://github.com/linkedin/beam/blob/li_trunk/runners/samza/src/main/java/org/apache/beam/runners/samza/translation/PortableTranslationContext.java#L45

Sanil15 avatar Aug 24 '22 16:08 Sanil15