Skip to content

Commit

Permalink
Add dummy global authkey
Browse files Browse the repository at this point in the history
Signed-off-by: James Noss <[email protected]>
  • Loading branch information
jamienoss committed Jan 21, 2022
1 parent b5d7c03 commit 47dc705
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions catkit/multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@

# NOTE: "multiprocess" is a 3rd party package and not Python's own "multiprocessing".
# https://github.com/uqfoundation/multiprocess is a fork of multiprocessing that uses "dill" instead of "pickle".
import multiprocess
import multiprocess.util as util
from multiprocess import get_context, TimeoutError
from multiprocess.managers import AcquirerProxy, AutoProxy, BarrierProxy, BaseProxy, DictProxy, EventProxy, \
NamespaceProxy, Server, State, SyncManager, ValueProxy, Token, format_exc

# A global auth key is needed to allow processes of separate groups to connect to one another.
# See https://bugs.python.org/msg214582
GLOBAL_AUTH_KEY = b"a super secure password"
multiprocess.current_process().authkey = GLOBAL_AUTH_KEY

DEFAULT_TIMEOUT = 60

Expand Down
3 changes: 3 additions & 0 deletions catkit/testbed/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def check(self):

class Testbed:
""" Class for owning testbed infrastructure such as any shared memory servers and running safety checks. """

# NOTE: The following event isn't implicitly used nor waited upon, it's hosted here such that it can be imported.
STOP_EVENT = "stop the testbed running"

def __init__(self, safety_tests, output_path=None, suffix=None,
safety_check_interval=60):
Expand Down

0 comments on commit 47dc705

Please sign in to comment.