[JAVA-3283] Log spamming from server monitor Created: 03/May/19  Updated: 28/Oct/23  Resolved: 09/May/19

Status: Closed
Project: Java Driver
Component/s: Monitoring
Affects Version/s: None
Fix Version/s: 3.11.0

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The server monitor is written to log at INFO level only when relevant server state has changed. Mostly it does a good job, but there are spurious log messages in one particular case, when a replica set member has multiple tags. The server does not ensure that those tags are provided in the isMaster response in the same order every time, and every time it changes the driver sees it as a relevant server state change, and so logs it. This results in spurious messages like:

... INFO ...Monitor thread successfully connected to server with description ServerDescription...

This could be fixed in the driver by ensuring a stable ordering of the tag sets (e.g. by sorting the tags by tag name)



 Comments   
Comment by Githook User [ 09/May/19 ]

Author:

{'email': 'jeff.yemin@10gen.com', 'name': 'Jeff Yemin', 'username': 'jyemin'}

Message: Ensure tag sets with the same tags compare equally

Order does not matter with a tag set, so they now sorted by name to
ensure that equivalent tag sets compare as equal

JAVA-3283
Branch: 3.10.x
https://github.com/mongodb/mongo-java-driver/commit/0933c9a627c901f195e7344918371e290e8634af

Comment by Githook User [ 09/May/19 ]

Author:

{'email': 'jeff.yemin@10gen.com', 'name': 'Jeff Yemin', 'username': 'jyemin'}

Message: Ensure tag sets with the same tags compare equally

Order does not matter with a tag set, so they now sorted by name to
ensure that equivalent tag sets compare as equal

JAVA-3283
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/0c42258d255ea2c8f2dcd74ff38a0404aae4b027

Generated at Thu Feb 08 08:59:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.