Skip to content

Commit d5fd06a

Browse files
committed
yarn: revert authkey generation
1 parent d648643 commit d5fd06a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

joblibhadoop/yarn/remotepool.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Remote workers pool manager module."""
22

3-
import os
3+
import string
4+
import random
45
from time import sleep
56
from threading import Thread
67
from multiprocessing.pool import Pool
@@ -57,7 +58,8 @@ def __init__(self, processes=None, port=0, authkey=None,
5758
"""
5859

5960
if authkey is None:
60-
self.authkey = os.urandom(32)
61+
options = string.ascii_letters + string.digits
62+
self.authkey = ''.join([random.choice(options) for _ in range(32)])
6163
else:
6264
self.authkey = authkey
6365

@@ -67,7 +69,7 @@ def __init__(self, processes=None, port=0, authkey=None,
6769
QueueManager.register('remove_worker', callable=self._remove_worker)
6870

6971
self.mgr = QueueManager(address=('', port),
70-
authkey=self.authkey)
72+
authkey=self.authkey.encode())
7173
self.server = self.mgr.get_server()
7274

7375
self.thread = Thread(target=self.server.serve_forever)

0 commit comments

Comments
 (0)