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
jobs,*: make job clients responsible for generating IDs
Job IDs used to be randomly generated in the job registry when creating
a job, which meant that they were not stable across restarts when jobs
were created in a txn closure meant to be idempotent. For
`StartableJobs`, we also created a tracing span and registered the "new"
job each time `CreateStartableJobWithTxn` was called, so these would
leak in the presence of restarts.
This commit adds a job ID argument to registry methods that create jobs,
so that callers can generate stable IDs. It also modifies the
`StartableJob` API to help ensure jobs (identified by a stable ID) are
only registered once in the presence of restarts:
`CreateStartableJobWithTxn` now takes a `*StartableJob`, and will not
create a tracing span and register the job again if the reference is
non-nil. This API is not ideal because it's probably easy to use it
incorrectly, but it at least makes the correct behavior on txn restarts
possible.
Release note: None
0 commit comments