@@ -904,18 +904,21 @@ def __init__(self, file_cacher, name=None, temp_dir=None):
904904 """
905905 SandboxBase .__init__ (self , file_cacher , name , temp_dir )
906906
907- # Isolate only accepts ids between 0 and 999 (by default). We assign
908- # the range [(shard+1)*10, (shard+2)*10) to each Worker and keep the
909- # range [0, 10) for other uses (command-line scripts like cmsMake or
910- # direct console users of isolate). Inside each range ids are assigned
911- # sequentially, with a wrap-around.
907+ NUM_IDS = 65000
908+ IDS_PER_SHARD = 1000
909+
910+ # Isolate only accepts ids up to 65000. We assign
911+ # the range [(shard+1)*1000, (shard+2)*1000) to each Worker and keep
912+ # the range [0, 1000) for other uses (command-line scripts like cmsMake
913+ # or direct console users of isolate). Inside each range ids are
914+ # assigned sequentially, with a wrap-around.
912915 # FIXME This is the only use of FileCacher.service, and it's an
913916 # improper use! Avoid it!
914917 if file_cacher is not None and file_cacher .service is not None :
915- box_id = ((file_cacher .service .shard + 1 ) * 10
916- + (IsolateSandbox .next_id % 10 )) % 1000
918+ box_id = ((file_cacher .service .shard + 1 ) * IDS_PER_SHARD
919+ + (IsolateSandbox .next_id % IDS_PER_SHARD )) % NUM_IDS
917920 else :
918- box_id = IsolateSandbox .next_id % 10
921+ box_id = IsolateSandbox .next_id % NUM_IDS
919922 IsolateSandbox .next_id += 1
920923
921924 # We create a directory "home" inside the outer temporary directory,
0 commit comments