Skip to content

Changelog 4.3 #1038

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 7 commits into from
Aug 18, 2022
Merged

Changelog 4.3 #1038

merged 7 commits into from
Aug 18, 2022

Conversation

bcwarner
Copy link
Contributor

Also updated the FAQ for the fork safety section.

PyMongo 4.3 brings a number of improvements including:

- Improved support for documents with BSON datetimes outside of the range
supported by Python. See :ref:`handling-out-of-range-datetimes` for examples.
Copy link
Member

Choose a reason for hiding this comment

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

Let's link to all of the new APIs too: MongoCLient's datetime_conversion arg, the DatetimeMS class, the enum, etc..

- Improved support for documents with BSON datetimes outside of the range
supported by Python. See :ref:`handling-out-of-range-datetimes` for examples.
- Improved support for avoiding deadlocking when a ``fork()`` occurs with an
:class:`~pymongo.mongo_client.MongoClient`.
Copy link
Member

Choose a reason for hiding this comment

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

I'd say "Add support for using a MongoClient before+after a fork()"

- Improved support for avoiding deadlocking when a ``fork()`` occurs with an
:class:`~pymongo.mongo_client.MongoClient`.
- Refactored several underlying classes in :mod:`pymongo.monitoring` for
connection events.
Copy link
Member

Choose a reason for hiding this comment

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

We don't need to mention the refactor since it doesn't affect end users.


- Updated :class:`~pymongo.change_stream.ChangeStream` so that it will
close after non-resumable non-timeout errors, and will resume its connection
otherwise.
Copy link
Member

Choose a reason for hiding this comment

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

I'd say "Fixed a bug where ChangeStream would allow an app to retry calling next() or try_next() even after non-resumable errors (PYTHON-3389_)"


.. _PYTHON-1824: https://jira.mongodb.org/browse/PYTHON-1824
.. _PYTHON-2484: https://jira.mongodb.org/browse/PYTHON-2484
.. _PYTHON-3312: https://jira.mongodb.org/browse/PYTHON-3312
Copy link
Member

Choose a reason for hiding this comment

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

Let's reference these inline like:

- Improved support for documents with BSON datetimes outside of the range
  supported by Python. See :ref:`handling-out-of-range-datetimes` for examples (`PYTHON-1824`_).


PyMongo 4.3 brings a number of improvements including:

- Improved support for documents with BSON datetimes outside of the range
Copy link
Member

Choose a reason for hiding this comment

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

"Improved support for documents with" -> "Added support for decoding BSON datetimes outside of the range supported by Python's datetime.datetime."

doc/faq.rst Outdated
using a client will result in all locks held by :class:`~bson.objectid
.ObjectId` and :class:`~pymongo.mongo_client.MongoClient` being released.
In addition, instances of :class:`~pymongo.topology.Topology` will be
replaced with identical settings. This feature is only available on
Copy link
Member

Choose a reason for hiding this comment

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

I would avoid mentioning details like the specific locks or Topology objects that we sanitize. Instead let's just say that PyMongo sanitizes its locks and shared state in the child process after fork() and hence pymongo is fork() safe (with caveats about compatible systems).

doc/faq.rst Outdated
deadlock in the child process due to the inherent incompatibilities between
``fork()``, threads, and locks described :ref:`below
<pymongo-fork-safe-details>`. PyMongo will attempt to issue a warning if
there is a chance of this deadlock occurring.
Copy link
Member

Choose a reason for hiding this comment

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

Should we just remove all the outdated sections now that pymongo is fork safe? The old non-fork safe behavior will still be readable on the docs for old versions on pymongo.

@bcwarner bcwarner requested a review from ShaneHarvey August 18, 2022 19:24
:ref:`handling-out-of-range-datetimes` for examples, as well as
:class:`pymongo.datetime_ms.DatetimeMS`,
:attr:`pymongo.codec_options.CodecOptions.datetime_conversion`,
:class:`pymongo.datetime_ms.DatetimeConversion` for more details
Copy link
Member

Choose a reason for hiding this comment

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

PyMongo 4.3 brings a number of improvements including:

- Added support for decoding BSON datetimes outside of the range supported
by Python's :class:`~datetime.datetime` See
Copy link
Member

Choose a reason for hiding this comment

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

Missing a . before See.

@bcwarner bcwarner requested a review from ShaneHarvey August 18, 2022 21:57
:class:`bson.codec_options.CodecOptions`'s ``datetime_conversion``
parameter for more details (`PYTHON-1824`_).
- Added support for using a :class:`~pymongo.mongo_client.MongoClient` after
a ``fork()`` (`PYTHON-2484`_).
Copy link
Member

Choose a reason for hiding this comment

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

fork() ->

:py:func:`os.fork`

@bcwarner bcwarner merged commit 09aeef0 into mongodb:master Aug 18, 2022
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