[JAVA-5185] Fix the ClusterListener, ServerListener, ServerMonitorListener API docs relevant to thread-safety Created: 28/Sep/23  Updated: 04/Oct/23  Resolved: 04/Oct/23

Status: Closed
Project: Java Driver
Component/s: Documentation
Affects Version/s: None
Fix Version/s: 4.11.0

Type: Improvement Priority: Unknown
Reporter: Valentin Kavalenka Assignee: Valentin Kavalenka
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
Problem/Incident
is caused by JAVA-4449 Publish cluster changed events in the... Closed
Backwards Compatibility: Fully Compatible
Documentation Changes: Needed
Documentation Changes Summary:

Let's mention in What's new that we fixed the documentation of ClusterListener, ServerListener, ServerMonitorListener. Users should not take the guarantee provided by these listeners as something that automatically spares them from synchronizing memory accesses.


 Description   

While the events are delivered to ClusterListener/ServerListener/ServerMonitorListener in a total order consistent with HB, these listeners still have to synchronize writes to shared memory with reads from it if the listeners write to shared memory. For a listener to be of any use, it has to write to shared memory, unless the only activity it does is logging or terminating the process.



 Comments   
Comment by Githook User [ 04/Oct/23 ]

Author:

{'name': 'Valentin Kovalenko', 'email': 'valentin.kovalenko@mongodb.com', 'username': 'stIncMale'}

Message: Fix the `ClusterListener`, `ServerListener`, `ServerMonitorListener` API docs relevant to thread-safety (#1208)

JAVA-5185
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/c7346bace3318a003bbae030e4904b50fa4e2a86

Generated at Thu Feb 08 09:03:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.