Skip to content

refactor: time session locks from Flow lock events - #450

Merged
heruan merged 1 commit into
mainfrom
refactor/session-lock-events
Oct 14, 2026
Merged

heruan merged 1 commit into
mainfrom
refactor/session-lock-events

Conversation

@totally-not-ai

@totally-not-ai totally-not-ai Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Review risk: two-way door — only the vaadin.session.lock.wait and vaadin.session.lock.hold timers; names and tags are unchanged.

Summary

The session lock timers now record the wait and hold times that Flow 25.4 reports on SessionLockAcquiredEvent and SessionLockReleasedEvent, instead of timing the lock in thread locals.

What changed

  • SessionLockMetricsBinder records getWaitTime() and getHoldTime() from the events and no longer keeps waitStart/holdStart thread locals.
  • The binder no longer listens for SessionLockRequestedEvent.
  • Behavior change: wait times for tryLock and lockInterruptibly are now real. Flow fires the requested event for these only after the lock is taken, so the old measurement was always close to zero.
  • Behavior change: hold time now starts when the lock is taken, so it also includes the time spent in other acquired-event listeners. Previously it started when this binder's listener ran.

Test summary

  • Wait and hold timers record the duration carried by the event, with the access and request context tags.
  • The init listener test now checks the acquired-event subscription, since the requested event is no longer used.
  • Micrometer module tests pass (497 tests).

Part of #416

🤖 Generated with Claude Code

Flow 25.4 reports the wait time on SessionLockAcquiredEvent and the
hold time on SessionLockReleasedEvent. Record those durations instead
of timing the lock in thread locals, and stop listening for
SessionLockRequestedEvent.

Wait time is now also measured for tryLock and lockInterruptibly, where
Flow fires the requested event only after the lock is taken, so the old
measurement was always close to zero.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@heruan
heruan marked this pull request as ready for review October 14, 2026 07:59
@heruan
heruan merged commit f82720e into main Oct 14, 2026
3 checks passed
@heruan
heruan deleted the refactor/session-lock-events branch October 14, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant