Skip to content

dispatcher: lift pipe buffer size restriction #434

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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 11 additions & 18 deletions dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,23 @@

import multiprocessing

# SimpleQueue is available from multiprocessing.queues on
# all Python versions known at the moment of writting the code
# (up to 3.9).
#
# It was additionally exposed directly from the multiprocessing
# module since Python 3.3 ([1]).
# Queue is available from multiprocessing.queues on all Python
# versions known at the moment of writting the code (up to 3.12).
#
# However the mandatory argument 'ctx'
# (see multiprocessing.get_context()) was added to the constructor
# of SimpleQueue from multiprocessing.queues since Python 3.4
# ([2]).
# of Queue from multiprocessing.queues since Python 3.4 ([1]).
#
# So we should import SimpleQueue from multiprocessing on
# Python 3.3+ (and must to do so on Python 3.4+) to uniformly
# instantiate it (without constructor arguments).
# So we should import Queue from multiprocessing on Python 3.4+
# to uniformly instantiate it (without constructor arguments).
#
# [1]: https://bugs.python.org/issue11836
# [2]: https://bugs.python.org/issue18999
# [1]: https://bugs.python.org/issue18999
try:
# Python 3.3+
from multiprocessing import SimpleQueue
# Python 3.4+
from multiprocessing import Queue
except ImportError:
# Python 2
from multiprocessing.queues import SimpleQueue
from multiprocessing.queues import Queue

from lib import Options
from lib.sampler import sampler
Expand Down Expand Up @@ -363,8 +356,8 @@ def __init__(self, key, task_group, randomize):
random.shuffle(self.task_ids)
else:
self.randomize = False
self.result_queue = SimpleQueue()
self.task_queue = SimpleQueue()
self.result_queue = Queue()
self.task_queue = Queue()

# Don't expose queues file descriptors over Popen to, say, tarantool
# running tests.
Expand Down
Loading