Skip to content
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

DOCSP-40094: Clarify MongoClient.close() behavior #898

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

norareidy
Copy link
Collaborator

@norareidy norareidy commented Aug 1, 2024

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-40094
Staging - https://preview-mongodbnorareidy.gatsbyjs.io/node/DOCSP-40094-close-behavior/faq/#how-does-connection-pooling-work-in-the-node-driver-

Self-Review Checklist

  • Is this free of any warnings or errors in the RST?
  • Did you run a spell-check?
  • Did you run a grammar-check?
  • Are all the links working?
  • Are the facets and meta keywords accurate?

Copy link
Collaborator

@rustagir rustagir left a comment

Choose a reason for hiding this comment

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

left a blocking change/suggestion

source/faq.txt Outdated
@@ -106,6 +106,12 @@ closes only inactive sockets, so you cannot interrupt or terminate
any ongoing operations by using this method. The driver closes these
sockets only when the process completes.

.. note::
Copy link
Collaborator

Choose a reason for hiding this comment

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

S: I think you should clip the last few sentences from the preceding paragraph and combine them into this note. Right now, the paragraph says

Calling MongoClient.close() closes only inactive sockets, so you cannot interrupt or terminate any ongoing operations by using this method. The driver closes these sockets only when the process completes.

But then this note contradicts that point. Maybe the combined content could express the following points:

  • Calling MongoClient.close() closes only inactive sockets
  • It also closes existing sessions and txns
  • So, even though you might not impact operations by closing a socket, you might impact an operation occurring in a transaction

@norareidy norareidy requested a review from rustagir August 1, 2024 20:11
Copy link
Collaborator

@rustagir rustagir left a comment

Choose a reason for hiding this comment

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

approving with some final wording suggestions!

source/faq.txt Outdated
closes only inactive sockets, so you cannot interrupt or terminate
any ongoing operations by using this method. The driver closes these
sockets only when the process completes.
closes only inactive sockets and does not actively terminate
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
closes only inactive sockets and does not actively terminate
closes only inactive sockets and does not directly terminate

source/faq.txt Outdated
Comment on lines 106 to 107
any ongoing operations. The driver closes in-use sockets only when
the operation completes. However, the ``MongoClient.close()`` method
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
any ongoing operations. The driver closes in-use sockets only when
the operation completes. However, the ``MongoClient.close()`` method
any ongoing operations. The driver closes any in-use sockets only when
the associated operations complete. However, the ``MongoClient.close()`` method

@norareidy norareidy merged commit b9bccea into mongodb:master Aug 2, 2024
2 checks passed
@norareidy norareidy deleted the DOCSP-40094-close-behavior branch August 2, 2024 14:31
norareidy added a commit that referenced this pull request Aug 2, 2024
* DOCSP-40094: Clarify MongoClient.close() behavior

* RR feedback

* RR feedback 2

(cherry picked from commit b9bccea)
norareidy added a commit that referenced this pull request Aug 2, 2024
* DOCSP-40094: Clarify MongoClient.close() behavior

* RR feedback

* RR feedback 2

(cherry picked from commit b9bccea)
norareidy added a commit that referenced this pull request Aug 2, 2024
* DOCSP-40094: Clarify MongoClient.close() behavior

* RR feedback

* RR feedback 2

(cherry picked from commit b9bccea)
norareidy added a commit that referenced this pull request Aug 2, 2024
* DOCSP-40094: Clarify MongoClient.close() behavior

* RR feedback

* RR feedback 2

(cherry picked from commit b9bccea)
norareidy added a commit that referenced this pull request Aug 2, 2024
* DOCSP-40094: Clarify MongoClient.close() behavior

* RR feedback

* RR feedback 2

(cherry picked from commit b9bccea)
norareidy added a commit that referenced this pull request Aug 2, 2024
* DOCSP-40094: Clarify MongoClient.close() behavior

* RR feedback

* RR feedback 2

(cherry picked from commit b9bccea)
norareidy added a commit that referenced this pull request Aug 2, 2024
* DOCSP-40094: Clarify MongoClient.close() behavior

* RR feedback

* RR feedback 2

(cherry picked from commit b9bccea)
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.

2 participants