Skip to content

Remove MacSafeQueue #3929

@benclifford

Description

@benclifford

Is your feature request related to a problem? Please describe.

MacSafeQueue was introduced in PR #1469 to allow the size of multiprocessing Queues to be observed - in the context of HTEX, but then also used in Parsl monitoring.

Subsequently, HTEX has ceased to make use of this class, but monitoring still uses it.

It looks like this implementation only works with the fork start method of multiprocessing. but Parsl has been moving away from this start method - see issue #3723.

The test case for MacSafeQueue (parsl/tests/test_regression/test_854.py) uses the default start method. With Python 3.14, on linux this has switched from fork to forkserver and so the test case now fails.

It fails in a way that makes me think it has never worked on MacOS's default spawn launch method. See #3856 for an example of a probably related failure.

What's happening, I think, is that in fork mode, the MacSafeQueue object is conveyed to the new process by unix fork; but in all other modes, the MacSafeQueue object is conveyed to the new process by being pickled. Queue (which MacSafeQueue inherits from) contains custom pickle handling, which does not properly convey the additional _counter attribute that MacSafeQueue adds on.

I thought about working on that pickle handling, and indeed had a brief unsuccessful hack, but I have realised that no part of Parsl currently makes use of the queue size except to determinine if it is 0, which is duplicate functionality with the .empty() method.

.empty() is, as far as I understand it, supported without MacSafeQueue, using the base Python multiprocessing.Queue class.

Describe the solution you'd like

remove MacSafeQueue implementation

Describe alternatives you've considered

further working on macsafequeue to have pickling support. there is no testing for macs in our CI, and this platform is unsupported -- moving towards mac behaviour behind the same as linux would be better than having divergent unsupported and untested code.

Additional context

@yadudoc wrote this implementation originally

@d33bs has reported a problem in #3723.

I encountered this on Linux while making draft Python 3.14 support in PR #3924

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions