Mentions légales du service

Skip to content

Fix timeout issue in new buffer

Lucas Meyer requested to merge fix-buffer into develop

This MR should fix the error noticed by @rcaulk:

2023-03-21 14:50:43,586:melissa.server.deep_learning.base_dl_server:ERROR Exception was raised in the receiving thread: empty range for randrange() Traceback (most recent call last): File "/gpfswork/rech/igf/commun/uhd97cp/melissa/melissa/server/deep_learning/", line 139, in receive self.buffer.put(data) File "/gpfswork/rech/igf/commun/uhd97cp/melissa/melissa/server/deep_learning/", line 148, in put super().put(watched_item, block, timeout) # type: ignore File "/gpfswork/rech/igf/commun/uhd97cp/melissa/melissa/server/deep_learning/", line 122, in put add_item = self._on_full(block=block, timeout=timeout) File "/gpfswork/rech/igf/commun/uhd97cp/melissa/melissa/server/deep_learning/", line 318, in _on_full index = random.randrange(len(self.seen)) File "/gpfslocalsup/pub/anaconda-py3/2022.05/envs/pytorch-gpu-1.13.0+py3.10.8/lib/python3.10/", line 321, in randrange raise ValueError("empty range for randrange()") ValueError: empty range for randrange() 2023-03-21 14:50:43,602:melissa.server.base_server:ERROR The server failed with an error

When the buffer is full, i.e. the container is full and no sample has been seen already, the put should wait until timeout possibly none is reach.

Merge request reports