409
return false, serviceerror.NewResourceExhausted(enumspb.RESOURCE_EXHAUSTED_CAUSE_BUSY_WORKFLOW, "workflow update is not yet accepted, please retry")
410
412
>
// stateSent: the update has been sent to the worker but not yet accepted.
413
>
// Buffer the callbacks in memory; they will be flushed to the event store
414
>
// when the update is accepted in onAcceptanceMsg.
415
>
// Returning (true, nil) is safe because:
416
>
// - The caller already holds the workflow lock
417
>
// - A workflow task already exists (the update was sent via one)
418
>
// - No new workflow task is needed — just buffer until acceptance
419
>
// - The event will be written atomically with acceptance
420
>
// If the Update struct is lost (registry cleared), the abort mechanism fires
421
>
// registryClearedErr on the caller's future, prompting an immediate retry.
422
>
if req.GetRequestId() != "" {
423
>
for _, pc := range u.pendingCallbacks {
424
if pc.requestID == req.GetRequestId() {
425
return true, nil