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
Fix synchronisation of bookmark access in reactive bookmark manager.
The separate reactive bookmark manager was introduced because Project Reactor and Blockhound have issues with the `ReentrantReadWriteLock` approach we have taken in the imperative approach.
The first approach was using a synchronized set, but as it was correctly noted by @seabamirum on #2769 this is not enough on the reading path:
> It is imperative that the user manually synchronize on the returned set when iterating over it:
(From the JavaDoc of `Collections.synchronizedSet`.
Using `ConcurrentHashMap.newKeySet` would solve that issue, but it would require a check for `null` values in the `usedBookmarks` argument for `updateBookmarks` AND it would also not solve the fact that removing the used bookmarks and adding the new ones is an atomic operation (such as it originally was in the imperative world).
So therefor it is just easier to use a standard set and synchronize over it.
0 commit comments