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

Improve forking support #804

Merged
merged 21 commits into from
Jan 10, 2024
Merged

Improve forking support #804

merged 21 commits into from
Jan 10, 2024

Commits on Dec 13, 2023

  1. Add forking helpers

    vickenty committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    36ba6e5 View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2023

  1. Configuration menu
    Copy the full SHA
    3b61696 View commit details
    Browse the repository at this point in the history
  2. Add stop method.

    vickenty committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    22de4ef View commit details
    Browse the repository at this point in the history
  3. Add opt-out

    vickenty committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    139993b View commit details
    Browse the repository at this point in the history
  4. Simplify locking

    Instead of separate locks for buffering and sender modes
    configuration, use the same lock.
    vickenty committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    63f53a1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    60a9f46 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1ccb2d8 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    95d5048 View commit details
    Browse the repository at this point in the history
  8. Document global fork hooks

    vickenty committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    6ddd736 View commit details
    Browse the repository at this point in the history
  9. Remove warning when stopping already stopped thread

    Now that disable_buffering and pre_fork may both try to stop the flush thread
    at the same time, attempt to stop an already stopped thread does not
    indicate a bug in the client code.
    vickenty committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    9082c7c View commit details
    Browse the repository at this point in the history
  10. Remove some redundant locking

    Single field assignement is atomic according to Python FAQ, so we
    don't need to protect reads and writes to self._queue as such. The
    only place where we need a lock is when stopping the sender, to ensure
    that the Stop marker is the last thing to be placed in there.
    
    https://docs.python.org/3/faq/library.html#what-kinds-of-global-value-mutation-are-thread-safe
    vickenty committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    e4e15bf View commit details
    Browse the repository at this point in the history
  11. Add type annotation for mypy

    vickenty committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    b536a1c View commit details
    Browse the repository at this point in the history
  12. Silence type error on os.register_at_fork

    os.register_at_fork is not available on all python versions, notably
    python 2.7. While we check for the availability explicitly, mypy
    cannot see through that and complains.
    vickenty committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    69b49f7 View commit details
    Browse the repository at this point in the history
  13. Fix formatting

    vickenty committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    ec8f504 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2024

  1. Configuration menu
    Copy the full SHA
    b378a96 View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2024

  1. Fix docstring

    vickenty committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    4363dd4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f923a46 View commit details
    Browse the repository at this point in the history
  3. Update docstring for enable_background_sender

    The method is now thread safe, and can be used with forking applications.
    vickenty committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    ee120f9 View commit details
    Browse the repository at this point in the history
  4. Fix docstring for enable_background_sender

    Re-format parameter descriptions so they are rendered correctly in the
    html docs.
    vickenty committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    9db758a View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2024

  1. Configuration menu
    Copy the full SHA
    35df4a1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0e5aa8e View commit details
    Browse the repository at this point in the history