Skip to content

Commit f7934a4

Browse files
committed
fix unittest
1 parent 7160a35 commit f7934a4

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

trinity/buffer/reader/queue_reader.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def __init__(self, config: StorageConfig):
1818
self.timeout = config.max_read_timeout
1919
self.read_batch_size = config.batch_size
2020
self.queue = QueueStorage.get_wrapper(config)
21-
ray.get(self.queue.acquire.remote())
2221

2322
def read(self, batch_size: Optional[int] = None, **kwargs) -> List:
2423
try:
@@ -48,6 +47,3 @@ def state_dict(self) -> Dict:
4847
def load_state_dict(self, state_dict):
4948
# Queue Not supporting state dict yet
5049
return None
51-
52-
def __del__(self):
53-
ray.get(self.queue.release.remote())

trinity/buffer/reader/sql_reader.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def __init__(self, config: StorageConfig) -> None:
1717
assert config.storage_type == StorageType.SQL.value
1818
self.wrap_in_ray = config.wrap_in_ray
1919
self.storage = SQLStorage.get_wrapper(config)
20-
ray.get(self.storage.acquire.remote())
2120

2221
def read(self, batch_size: Optional[int] = None, **kwargs) -> List:
2322
if self.wrap_in_ray:
@@ -41,6 +40,3 @@ def state_dict(self) -> Dict:
4140
def load_state_dict(self, state_dict):
4241
# SQL Not supporting state dict yet
4342
return None
44-
45-
def __del__(self):
46-
ray.get(self.storage.release.remote())

trinity/explorer/explorer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,9 @@ async def shutdown(self) -> None:
448448
self.scheduler = None
449449
if self.experience_pipeline:
450450
await self.experience_pipeline.close.remote()
451+
# reserve `experience_pipeline.output` for trainer
452+
# TODO: refactor the lifecycle of buffer actor
453+
self._old_experience_pipeline = self.experience_pipeline
451454
self.experience_pipeline = None
452455
if self.monitor:
453456
self.monitor.close()

0 commit comments

Comments
 (0)