Closed Bug 2077141 Opened 1 month ago Closed 5 days ago

Evaluate flow `auto_close_timeout` lazily

Categories

(Data Platform and Tools :: Glean: SDK, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: travis_, Assigned: travis_)

References

(Blocks 2 open bugs)

Details

Attachments

(1 external file)

Close a flow instance with reason: timeout once its auto_close_timeout has elapsed. Depends on the lifecycle bug.

Whether the timeout is measured from when the instance opened or from the instance's last tagged event is an open question on the meta, and needs an answer before work starts. The proposal currently specifies time since the instance opened.

There is no timer thread, matching the session inactivity timeout. Check an instance's timeout whenever the SDK is already handling it:

  • before adding a flows entry for it to an event,
  • when an entry or exit event for its flow is recorded,
  • in handle_client_active() and handle_client_inactive(),
  • at session end, before closing remaining instances with reason: session_end.

An expired instance is closed with reason: timeout before the event that noticed it is tagged, so that event does not carry it. If the event is in that flow's starts_on, a new instance opens in the same recording.

glean.flow_end is timestamped when the expiry is noticed, not when the timeout elapsed. Document this in the flow_end metric description.

Instances without auto_close_timeout (if the field stays optional) never time out and end only by exit or session end.

Restoring state at startup also checks timeouts. That is covered in the persistence bug.

Blocks: 2077152
Blocks: 2077127

(via GitHub webhook, authenticated as shared-secret)

Assignee: nobody → tlong
Status: NEW → ASSIGNED
Priority: P3 → P1
Status: ASSIGNED → RESOLVED
Closed: 5 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: