Skip to content

Commit 7c3536e

Browse files
authored
fix: GTFS validator GCP workflow takes too much time to complete (#1093)
1 parent b0dac39 commit 7c3536e

File tree

1 file changed

+3
-53
lines changed

1 file changed

+3
-53
lines changed

workflows/gtfs_validator_execution.yml

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ main:
116116
result: executionResultResponse
117117
- validateStatus:
118118
next: logExecutionResult
119-
# Retrying 120 times with a delay of 10 seconds each time gives 20 minutes wait time.
119+
# Retrying 120 times with a delay of 30 seconds each time gives 60 minutes wait time.
120120
retry:
121121
predicate: ${retry_predicate}
122122
max_retries: 120
123123
backoff:
124-
initial_delay: 10
125-
max_delay: 10
124+
initial_delay: 30
125+
max_delay: 30
126126
multiplier: 1
127127
- logExecutionResult:
128128
steps:
@@ -253,56 +253,6 @@ main:
253253
args:
254254
text: ${"Created task for feed " + feedID + " Task ID:" + taskResponse.name}
255255
severity: INFO
256-
# The waitForTaskCompletion will wait for HTTP error status 404 from google API.
257-
# The cloud tasks API doesn't return a status field and when the task success it HTTP returns 404(tasks not found).
258-
- waitForTaskCompletion:
259-
try:
260-
steps:
261-
- getTaskStatus:
262-
call: googleapis.cloudtasks.v2beta3.projects.locations.queues.tasks.get
263-
args:
264-
name: ${taskResponse.name}
265-
result: taskStatus
266-
- printTaskStatus:
267-
call: sys.log
268-
args:
269-
text: ${taskStatus}
270-
severity: INFO
271-
next: retryTaskStatus
272-
except:
273-
as: error
274-
steps:
275-
- printExceptTaskStatus:
276-
call: sys.log
277-
args:
278-
text: ${"HTTP error raised while calling get tasks endpoint:" + error.message}
279-
severity: INFO
280-
- handle404:
281-
switch:
282-
- condition: ${error.code == 404}
283-
next: logTaskCompletion
284-
- condition: ${error.code != 404}
285-
raise: ${error}
286-
- retryTaskStatus:
287-
call: sys.sleep
288-
args:
289-
seconds: 30
290-
next: waitForTaskCompletion
291-
- logTaskCompletion:
292-
call: sys.log
293-
args:
294-
text: ${"Completed task for feed " + feedID + " Task ID:" + taskResponse.name}
295-
severity: INFO
296-
next: successfulExecution
297-
- fileExistenceTimeout:
298-
steps:
299-
- logFileExistenceTimeout:
300-
call: sys.log
301-
args:
302-
text: ${"File not found after 20 minutes for datasetID " + datasetID }
303-
severity: ERROR
304-
- returnFileNotFound:
305-
return: ${"File not found after 20 minutes for datasetID " + datasetID }
306256
- successfulExecution:
307257
steps:
308258
- logSuccessfulExecution:

0 commit comments

Comments
 (0)