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

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

                Author: ASF GitHub Bot
            Created on: 29/Jun/21 04:20
            Start Date: 29/Jun/21 04:20
    Worklog Time Spent: 10m 
      Work Description: aaltay commented on a change in pull request #6535:
URL: https://github.com/apache/beam/pull/6535#discussion_r660268908



##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -155,9 +155,15 @@ def rank_error(msg):
               or str(response.currentState) == 'JOB_STATE_UPDATED'
               or str(response.currentState) == 'JOB_STATE_DRAINED'):
             break
-          # The job has failed; ensure we see any final error messages.
-          sleep_secs = 1.0      # poll faster during the final countdown
-          final_countdown_timer_secs -= sleep_secs
+
+          # Check that job is in a post-preparation state before starting the
+          # final countdown.
+          if (str(response.currentState) not in (
+              'JOB_STATE_PENDING', 'JOB_STATE_QUEUED')):

Review comment:
       It does not look like another pre-running state was added. (See for 
reference: 
https://cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs)
   
   > Another possibly related instance: 
stackoverflow.com/questions/68128465/is-it-possible-to-stop-the-job-in-starting-state
   
   According to the same link:
   pending -> cancelling is not a valid transition
   queued -> cancelling is a valid transition
   
   (But the doc might also be out of date.)
   
   Thank you for filing the jira. Please share jira id here for reference.
   




-- 
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: 615986)
    Time Spent: 3h 40m  (was: 3.5h)

> Dataflow runner raises AssertionError if job takes > 50 seconds to go from 
> PENDING to RUNNING
> ---------------------------------------------------------------------------------------------
>
>                 Key: BEAM-5529
>                 URL: https://issues.apache.org/jira/browse/BEAM-5529
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>    Affects Versions: 2.6.0
>            Reporter: Joar Wandborg
>            Assignee: Ahmet Altay
>            Priority: P2
>             Fix For: 2.8.0
>
>          Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> To reproduce:
>  - Try to run a Pipeline that takes longer than 50 seconds to go from 
> JOB_STATE_PENDING to JOB_STATE_RUNNING using "with Pipeline() as pipeline:" 
> (automatically executes {{pipeline.run().wait_until_finish()}} via 
> {{Pipeline.__exit__}}) on Dataflow.
>  - Your script will raise "AssertionError: Job did not reach to a terminal 
> state after waiting indefinitely." (from 
> [https://github.com/apache/beam/blob/766a1dc5b6523a0b7a3ce0a9ab78901cf17c9013/sdks/python/apache_beam/runners/dataflow/dataflow_runner.py#L1152-L1153])
> I think the issue is that the block at 
> [https://github.com/apache/beam/blob/766a1dc5b6523a0b7a3ce0a9ab78901cf17c9013/sdks/python/apache_beam/runners/dataflow/dataflow_runner.py#L147-L160]
>  unintentionally exits if it takes > 50 seconds for a job to go from 
> JOB_STATE_PENDING to JOB_STATE_RUNNING.



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

Reply via email to