mirror of
https://github.com/wassname/ray.git
synced 2026-07-15 11:25:40 +08:00
Speed up actor creation task submission by generating IDs with uuid. (#1744)
* Speed up actor creation task submission by generating IDs deterministically. * Revert "Speed up actor creation task submission by generating IDs deterministically." This reverts commit 175d9587302664916ce9db4071185485da8da041. * Don't generate actor IDs deterministically yet. * Factor out ID generation method.
This commit is contained in:
committed by
Philipp Moritz
parent
d78de0d41f
commit
f88a2544bf
+7
-1
@@ -4,9 +4,11 @@ from __future__ import print_function
|
||||
|
||||
import binascii
|
||||
import collections
|
||||
import hashlib
|
||||
import numpy as np
|
||||
import os
|
||||
import sys
|
||||
import uuid
|
||||
|
||||
import ray.local_scheduler
|
||||
|
||||
@@ -15,7 +17,11 @@ DRIVER_ID_LENGTH = 20
|
||||
|
||||
|
||||
def _random_string():
|
||||
return np.random.bytes(20)
|
||||
id_hash = hashlib.sha1()
|
||||
id_hash.update(uuid.uuid4().bytes)
|
||||
id_bytes = id_hash.digest()
|
||||
assert len(id_bytes) == 20
|
||||
return id_bytes
|
||||
|
||||
|
||||
def format_error_message(exception_message, task_exception=False):
|
||||
|
||||
Reference in New Issue
Block a user