[ 
https://issues.apache.org/jira/browse/BEAM-12794?focusedWorklogId=647515&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-647515
 ]

ASF GitHub Bot logged work on BEAM-12794:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Sep/21 18:27
            Start Date: 07/Sep/21 18:27
    Worklog Time Spent: 10m 
      Work Description: ibzib commented on a change in pull request #15417:
URL: https://github.com/apache/beam/pull/15417#discussion_r703737216



##########
File path: sdks/python/apache_beam/utils/exception.py
##########
@@ -0,0 +1,43 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+from types import TracebackType
+from typing import Optional
+from typing import Tuple
+from typing import Type
+from typing import Union
+
+
+def raise_exception(
+    error_type: Type[BaseException],
+    value: Optional[Union[Tuple, BaseException]],
+    traceback: Optional[TracebackType]):
+  """
+  Raise Exception from exc_info.
+  Derived from `future.utils.raise_`
+  """
+  if isinstance(value, error_type):
+    exc = value
+  elif isinstance(value, tuple):

Review comment:
       Can we add tests for these three cases? 
https://codecov.io/gh/apache/beam/compare/cbb363f2f01d44dd3f7c063c6cd9d529b5fa9104...0116804e338390d438edaf4b6f7ac18d46a4d043/diff




-- 
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 647515)
    Time Spent: 3h 40m  (was: 3.5h)

> PortableRunnerTestWithExternalEnv.test_pardo_timers flaky
> ---------------------------------------------------------
>
>                 Key: BEAM-12794
>                 URL: https://issues.apache.org/jira/browse/BEAM-12794
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-harness, test-failures
>            Reporter: Kyle Weaver
>            Assignee: yoshiki obata
>            Priority: P1
>          Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> In python precommit.
> Looks like there's also a bug in error handling. IIUC, this call is intended 
> to be a "cast" but really it's calling an arbitrary constructor, which may 
> take different arguments than a
>  BaseException. 
> https://github.com/apache/beam/blob/4559c75863d9d6c9dd9e48c2b4f12f2139410524/sdks/python/apache_beam/runners/worker/sdk_worker.py#L1105
>  cc[~tvalentyn] [~yoshiki.obata]
>   
>  
> [https://ci-beam.apache.org/job/beam_PreCommit_Python_Phrase/2755/testReport/junit/apache_beam.runners.portability.portable_runner_test/PortableRunnerTestWithExternalEnv/test_pardo_timers/]
>   
>  E RuntimeError: Pipeline job-721c3984-7f9c-4991-8473-c7d8c02f4d13 failed in 
> state FAILED: Error running pipeline. E Traceback (most recent call last): E 
> File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/portability/local_job_service.py",
>  line 274, in _run_job E self._pipeline_proto) E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner.py",
>  line 206, in run_via_runner_api E return self.run_stages(stage_context, 
> stages) E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner.py",
>  line 385, in run_stages E runner_execution_context, bundle_context_manager) 
> E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner.py",
>  line 653, in _run_stage E bundle_manager)) E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner.py",
>  line 770, in _run_bundle E data_input, data_output, input_timers, 
> expected_timer_output) E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner.py",
>  line 1120, in process_bundle E raise RuntimeError(result.error) E 
> RuntimeError: Traceback (most recent call last): E File 
> "apache_beam/runners/common.py", line 1258, in 
> apache_beam.runners.common.DoFnRunner.process_user_timer E 
> self.do_fn_invoker.invoke_user_timer( E File "apache_beam/runners/common.py", 
> line 528, in apache_beam.runners.common.DoFnInvoker.invoke_user_timer E 
> self.output_processor.process_outputs( E File 
> "apache_beam/runners/common.py", line 1368, in 
> apache_beam.runners.common._OutputProcessor.process_outputs E for result in 
> results: E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner_test.py",
>  line 366, in process_timer E if state.read() == 0: E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/worker/bundle_processor.py",
>  line 481, in read E return 
> self._combinefn.extract_output(self._read_accumulator()) E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/worker/bundle_processor.py",
>  line 473, in _read_accumulator E self._underlying_bag_state.read()) E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/transforms/core.py",
>  line 1038, in merge_accumulators E return 
> [self._fn(_ReiterableChain(accumulators), *args, **kwargs)] E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/transforms/core.py",
>  line 976, in __iter__ E for iterable in self.iterables: E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/worker/bundle_processor.py",
>  line 521, in __iter__ E for elem in self.first: E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/worker/bundle_processor.py",
>  line 353, in __iter__ E self._state_handler.blocking_get(self._state_key, 
> self._coder_impl)) E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/worker/sdk_worker.py",
>  line 1194, in blocking_get E self._partially_cached_iterable(state_key, 
> coder)) E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/worker/sdk_worker.py",
>  line 1300, in _partially_cached_iterable E data, continuation_token = 
> self._underlying.get_raw(state_key, None) E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/worker/sdk_worker.py",
>  line 1067, in get_raw E continuation_token=continuation_token))) E File 
> "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Phrase/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/worker/sdk_worker.py",
>  line 1105, in _blocking_request E raise t(v).with_traceback(tb) E TypeError: 
> __init__() missing 3 required positional arguments: 'call', 
> 'response_deserializer', and 'deadline'



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to