You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: job id race condition with large, dynamic matrices (#451)
* fix: job id race condition with large, dynamic matrices
When you execute a matrix job, and the matrix is dynamic
(i.e. based on the output of a previous job; for example,
a change detection job that looks for workspaces that had changes),
then GitHub won't immediately show the full job list for
the current workflow run. You can observe this in the GitHub UI,
where the matrix slowly gets more job instances, even as the
matrix jobs instances are starting.
Unfortunately, even after a matrix job instance has started
executing, it may not be visible in the UI or API yet.
This means that the API call which TF-via-PR makes to get the job id
is not guaranteed to succeed, and in practice it will reliably
fail if the dynamic matrix is large enough (e.g. 50 instances),
and if the `identifier` step of the `TF-via-PR` action is
reached quickly enough.
This PR adds a workaround for that issue, where the API call
will be retried with exponential backoff, up to a maximum limit
of attempts. In practice, this should avoid the race condition
without introducing too much complexity, despite being a bit inelegant.
* Comment
---------
Co-authored-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com>
0 commit comments