You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Triage: valid sub-task, blocked. It can't start until the per-UI lock core (#27582) exists. Nothing on main implements UI locks yet.
Where it fits: push and stream/upload requests take the session lock in a few central places. Most of them go through one helper (SessionLockScope), so the change is mostly "lock the UI instead when the flag is on" in those places.
Next step: wait for UI locking: per-UI lock core behind an experimental feature flag #27582 to merge. Two points to settle first, with my recommendations: 1. Should user code in stream and upload handlers (StreamResourceWriter, upload callbacks, UploadEvent) run with only the UI lock? (recommended: yes, like UIDL event handling) 2. Should looking up the stream resource and the UI keep a short session lock first, before the UI lock is taken? (recommended: yes, until UI locking: make VaadinSession internals thread-safe #27581 makes the registry thread-safe). Once UI locking: per-UI lock core behind an experimental feature flag #27582 is in, a maintainer reply that mentions @totally-not-ai with the answers (e.g. @totally-not-ai 1: yes, 2: yes) is enough for me to open a PR. Others are welcome to weigh in.
Stream resource lookup and element resources: StreamRequestHandler (registry lookup, then a second lock for the inert, disabled and attached checks and the UI lookup) and StreamResourceHandler.
Uploads: StreamReceiverHandler locks for the owner and node checks and for each StreamVariable callback (SessionLockScope.lock(session, ui)). The upload data itself is already read without the lock.
Activity
totally-not-ai commentedon Dec 1, 2026
Triage: valid sub-task, blocked. It can't start until the per-UI lock core (#27582) exists. Nothing on
mainimplements UI locks yet.SessionLockScope), so the change is mostly "lock the UI instead when the flag is on" in those places.StreamResourceWriter, upload callbacks,UploadEvent) run with only the UI lock? (recommended: yes, like UIDL event handling) 2. Should looking up the stream resource and the UI keep a short session lock first, before the UI lock is taken? (recommended: yes, until UI locking: make VaadinSession internals thread-safe #27581 makes the registry thread-safe). Once UI locking: per-UI lock core behind an experimental feature flag #27582 is in, a maintainer reply that mentions@totally-not-aiwith the answers (e.g.@totally-not-ai 1: yes, 2: yes) is enough for me to open a PR. Others are welcome to weigh in.Where the session lock is taken today
PushHandlercallWithUi and connection lost, both throughSessionLockScope.StreamRequestHandler(registry lookup, then a second lock for the inert, disabled and attached checks and the UI lookup) andStreamResourceHandler.StreamReceiverHandlerlocks for the owner and node checks and for eachStreamVariablecallback (SessionLockScope.lock(session, ui)). The upload data itself is already read without the lock.UploadEvent.getUI()locks the session to find the UI by id.Notes for the tests