Closed Bug 2077139 Opened 1 month ago Closed 7 days ago

Terminate active flow instances when the session ends

Categories

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

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: travis_, Assigned: travis_)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

No flow instance may span a session boundary. When a session ends, close every active instance with reason: session_end before glean.session_end is recorded. Depends on the lifecycle bug.

  • Hook in at the top of Glean::session_end(), before session::clear() and SessionManager::reset_state(). Each glean.flow_end must be recorded with an in-session context while the ending session is still current, so it gets a session.event_seq from that session.
  • This covers every reason that goes through session_end(): replaced, timeout, inactive, and explicit calls. The paths that call record_session_end_event() directly (dirty-flag recovery, and abandonment on session mode change at startup) are handled in the persistence bug.
  • Close instances in reverse order of opening.
  • Reset the session-wide flow counter at session start, so the first instance in a session has flow_seq 0.

Tests: assert the order in the events ping is the last member event, then one glean.flow_end per active instance in reverse order of opening, then glean.session_end. Cover at least the replaced and AUTO-mode timeout paths. In the timeout case session_end() runs on the next handle_client_active(), so flow_end is timestamped when the timeout is noticed, the same as session_end.

Blocks: 2077143
Blocks: 2077152

(via GitHub webhook, authenticated as shared-secret)

Assignee: nobody → tlong
Priority: P3 → P1
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 7 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: