eclipse-scout / scout.rt

https://www.eclipse.org/scout/
Eclipse Public License 2.0
34 stars 39 forks source link

UiNotificationRegistry: fix potential deadlock when notifying listeners #1122

Closed andibur closed 1 month ago

andibur commented 1 month ago

putInternal notified listeners while holding the write lock (i.e. an open call). With the current primary use case, this led to deadlocks: The async servlet request was responded, but the thread did not return until the response was completely processed by the client. In some cases the client did not consume the message. Hence, the listener did not complete and kept the writeLock. Restarting the UI server did close the network connection. As a result, the listener completed (with an exception) and finally released the write lock (the client-side issue is already addressed by 487dffe74adec5a7a7e138f4882573344e1158f4).

Further, the commit slightly improves performance of cleanup.

393563