Skip to content

CSHARP-4327: Update Server Monitoring documentation #967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

JamesKovacs
Copy link
Contributor

Including correct commands and information on polling (<=4.2) versus streaming (>=4.4).

…ands and information on polling (<=4.2) versus streaming (>=4.4).
@JamesKovacs JamesKovacs requested a review from BorisDog November 23, 2022 23:26
MongoDB 4.4 or later: The `MongoClient` establishes an exhaust cursor to each discovered cluster node using `{ hello: 1 }` (or legacy hello). Cluster nodes push topology updates to `MongoClient`.
MongoDB 4.2 or ealier: The `MongoClient` polls each discovered cluster node every [heartbeatFrequencyMS](https://www.mongodb.com/docs/manual/reference/connection-string/#mongodb-urioption-urioption.heartbeatFrequencyMS) (default 10 seconds, MongoDB Atlas 5 seconds) using `{ hello: 1 }` (or legacy hello).

When servers go down, the frequency of these calls will be increased to 500 milliseconds. See the [Server Discovery and Monitoring Specification](https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring-summary.rst) for more information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have such logic about 500ms? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we do:

public ServerMonitorSettings(TimeSpan connectTimeout, TimeSpan heartbeatInterval, Optional<TimeSpan> minHeartbeatInterval = default)
{
    _connectTimeout = connectTimeout;
    _heartbeatInterval = heartbeatInterval;
    _minHeartbeatInterval = minHeartbeatInterval.WithDefault(TimeSpan.FromMilliseconds(500));
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I misunderstood, I meant that we don't wait if network error in streaming

Copy link
Contributor

@BorisDog BorisDog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JamesKovacs JamesKovacs merged commit bfb1570 into mongodb:master Nov 23, 2022
JamesKovacs added a commit that referenced this pull request Nov 23, 2022
…ands and information on polling (<=4.2) versus streaming (>=4.4). (#967)
dnickless pushed a commit to dnickless/mongo-csharp-driver that referenced this pull request Aug 24, 2023
…ands and information on polling (<=4.2) versus streaming (>=4.4). (mongodb#967)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants