Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exception sampling logic #33076

Merged
merged 5 commits into from
Nov 11, 2024
Merged

Fix exception sampling logic #33076

merged 5 commits into from
Nov 11, 2024

Conversation

damccorm
Copy link
Contributor

Right now, PreCommit Python is persistently red - https://github.com/apache/beam/actions/workflows/beam_PreCommit_Python.yml?query=event%3Aschedule

When this goes red, we see the following errors:

Traceback (most recent call last): |  
  | File "apache_beam/runners/common.py", line 1501, in apache_beam.runners.common.DoFnRunner.process |  
  | return self.do_fn_invoker.invoke_process(windowed_value) |  
  | File "apache_beam/runners/common.py", line 689, in apache_beam.runners.common.SimpleInvoker.invoke_process |  
  | self.output_handler.handle_process_outputs( |  
  | File "apache_beam/runners/common.py", line 1687, in apache_beam.runners.common._OutputHandler.handle_process_outputs |  
  | self._write_value_to_tag(tag, windowed_value, watermark_estimator) |  
  | File "apache_beam/runners/common.py", line 1800, in apache_beam.runners.common._OutputHandler._write_value_to_tag |  
  | self.main_receivers.receive(windowed_value) |  
  | File "apache_beam/runners/worker/operations.py", line 263, in apache_beam.runners.worker.operations.SingletonElementConsumerSet.receive |  
  | self.consumer.process(windowed_value) |  
  | File "apache_beam/runners/worker/operations.py", line 950, in apache_beam.runners.worker.operations.DoOperation.process |  
  | with self.scoped_process_state: |  
  | File "apache_beam/runners/worker/operations.py", line 951, in apache_beam.runners.worker.operations.DoOperation.process |  
  | delayed_applications = self.dofn_runner.process(o) |  
  | File "apache_beam/runners/common.py", line 1503, in apache_beam.runners.common.DoFnRunner.process |  
  | self._reraise_augmented(exn, windowed_value) |  
  | File "apache_beam/runners/common.py", line 1611, in apache_beam.runners.common.DoFnRunner._reraise_augmented |  
  | self._maybe_sample_exception(exc_info, windowed_value) |  
  | TypeError: Argument 'exn' has incorrect type (expected BaseException, got tuple) |  

This is because we pass sys.exc_info(), which returns a tuple, into a class expecting just the exception. This fixes that problem (though not the PreCommit yet)


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

  • 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 or the workflows README to see a list of phrases to trigger workflows.

@damccorm
Copy link
Contributor Author

Merging despite failing checks because this has sent a bunch of checks green and has reduced the number of failing tests for precommit python

@damccorm damccorm merged commit c6549e7 into master Nov 11, 2024
86 of 88 checks passed
@damccorm damccorm deleted the users/damccorm/fixSampling branch November 11, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants