Skip to content

fix(StateMediator): Double StopEvent timeout to 60s - #1067

Merged
runkelcorey merged 1 commit into
masterfrom
fix-API-AAR-double-stop-event-timeout
Aug 18, 2026
Merged

fix(StateMediator): Double StopEvent timeout to 60s#1067
runkelcorey merged 1 commit into
masterfrom
fix-API-AAR-double-stop-event-timeout

Conversation

@runkelcorey

@runkelcorey runkelcorey commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Doubles sync_timeout for StopEvents in the hopes (gulp) of quashing API-AAR. This is a coarse knob to turn but I think it's premature to try other options. Since #1065, all incremental updates take less than 2s to process but the initial load of StopEvent can take upwards of 10s. It seems like the startup of the supervision tree imposes additional performance impacts on this loading process and, yesterday, dev experienced API-AAR once again.

My question for the reviewer is: is there a better way to only adjust the initial timeout? I don't want to enable this to silently take 50s on incremental loads. After investigating, I don't see a backwards compatible way to do this: timeout options are passed by a private function in S3Mediator that's used for initial as well as recurring updates. The equivalent function in Mediator is never modified and this would be a break with the existing design pattern (plus, redundant code for the CR crowding case).

@runkelcorey runkelcorey self-assigned this Aug 11, 2026
@runkelcorey
runkelcorey requested a review from a team as a code owner August 11, 2026 16:05
@runkelcorey runkelcorey added the bug Something isn't working label Aug 11, 2026
@runkelcorey
runkelcorey requested review from npatel-mbta and removed request for a team August 11, 2026 16:05
@runkelcorey
runkelcorey marked this pull request as draft August 13, 2026 14:33
@runkelcorey
runkelcorey marked this pull request as ready for review August 13, 2026 15:53

@npatel-mbta npatel-mbta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably good as is.

Is there logging/other way to check effectiveness of the change?

@runkelcorey

Copy link
Copy Markdown
Contributor Author

Is there logging/other way to check effectiveness of the change?

Not as much as I'd like. I'm still unsure why https://mbtace.sentry.io/issues/7395872189/events/a00525a16a1149e4bbed4ae1cee2226f/ recurs when we see log messages like init_table Elixir.State.StopEvent #PID<0.2898.0> took 7592.186ms. My theory is that the processes that handle the message are being paused by the supervision tree mid-execution because, on startup, the GenServer needs to refresh the entire table. The only real metric is the continued absence of that Sentry error

@runkelcorey
runkelcorey merged commit 1b0fc5a into master Aug 18, 2026
69 checks passed
@runkelcorey
runkelcorey deleted the fix-API-AAR-double-stop-event-timeout branch August 18, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants