Billiard

Latest version: v4.2.0

Safety actively analyzes 630450 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 10 of 11

2.7.3.11

---------------------

- Adds support for FreeBSD 7+

Fix contributed by koobs.

- Pool: New argument ``allow_restart`` is now required to enable
the pool process sentinel that is required to restart the pool.

It's disabled by default, which reduces the number of file
descriptors/semaphores required to run the pool.

- Pool: Now emits a warning if a worker process exited with error-code.

But not if the error code is 155, which is now returned if the worker
process was recycled (maxtasksperchild).

- Python 3 compatibility fixes.

- Python 2.5 compatibility fixes.

2.7.3.10

---------------------

- The ``TimeLimitExceeded`` exception string representation
only included the seconds as a number, it now gives a more human
friendly description.

- Fixed typo in ``LaxBoundedSemaphore.shrink``.

- Pool: ``ResultHandler.handle_event`` no longer requires
any arguments.

- setup.py bdist now works

2.7.3.9

--------------------

- Environment variable ``MP_MAIN_FILE`` envvar is now set to
the path of the ``__main__`` module when execv is enabled.

- Pool: Errors occurring in the TaskHandler are now reported.

2.7.3.8

--------------------

- Can now be installed on Py 3.2

- Issue 12091: simplify ApplyResult and MapResult with threading.Event

Patch by Charles-Francois Natali

- Pool: Support running without TimeoutHandler thread.

- The with_*_thread arguments has also been replaced with
a single `threads=True` argument.

- Two new pool callbacks:

- ``on_timeout_set(job, soft, hard)``

Applied when a task is executed with a timeout.

- ``on_timeout_cancel(job)``

Applied when a timeout is cancelled (the job completed)

2.7.3.7

--------------------

- Fixes Python 2.5 support.

2.7.3.6

--------------------

- Pool: Can now be used in an event loop, without starting the supporting
threads (TimeoutHandler still not supported)

To facilitate this the pool has gained the following keyword arguments:

- ``with_task_thread``
- ``with_result_thread``
- ``with_supervisor_thread``
- ``on_process_up``

Callback called with Process instance as argument
whenever a new worker process is added.

Used to add new process fds to the eventloop::

def on_process_up(proc):
hub.add_reader(proc.sentinel, pool.maintain_pool)

- ``on_process_down``

Callback called with Process instance as argument
whenever a new worker process is found dead.

Used to remove process fds from the eventloop::

def on_process_down(proc):
hub.remove(proc.sentinel)

- ``semaphore``

Sets the semaphore used to protect from adding new items to the
pool when no processes available. The default is a threaded
one, so this can be used to change to an async semaphore.

And the following attributes::

- ``readers``

A map of ``fd`` -> ``callback``, to be registered in an eventloop.
Currently this is only the result outqueue with a callback
that processes all currently incoming results.

And the following methods::

- ``did_start_ok``

To be called after starting the pool, and after setting up the
eventloop with the pool fds, to ensure that the worker processes
didn't immediately exit caused by an error (internal/memory).

- ``maintain_pool``

Public version of ``_maintain_pool`` that handles max restarts.

- Pool: Process too frequent restart protection now only counts if the process
had a non-successful exit-code.

This to take into account the maxtasksperchild option, and allowing
processes to exit cleanly on their own.

- Pool: New options max_restart + max_restart_freq

This means that the supervisor can't restart processes
faster than max_restart' times per max_restart_freq seconds
(like the Erlang supervisor maxR & maxT settings).

The pool is closed and joined if the max restart
frequency is exceeded, where previously it would keep restarting
at an unlimited rate, possibly crashing the system.

The current default value is to stop if it exceeds
100 * process_count restarts in 1 seconds. This may change later.

It will only count processes with an unsuccessful exit code,
this is to take into account the ``maxtasksperchild`` setting
and code that voluntarily exits.

- Pool: The ``WorkerLostError`` message now includes the exit-code of the
process that disappeared.

Page 10 of 11

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.