data
data copied to clipboard
Daemonize reading service's processes
@VitalyFedyunin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
I just tried this locally. It does terminate but it returns the following error:
Exception ignored in: <function DataLoader2.__del__ at 0x7f96eb666820> Traceback (most recent call last): File "/Users//data/torchdata/dataloader2/dataloader2.py", line 134, in __del__ File "/Users//data/torchdata/dataloader2/dataloader2.py", line 142, in shutdown File "/Users//data/torchdata/dataloader2/reading_service.py", line 296, in finalize File "/Users//data/torchdata/dataloader2/reading_service.py", line 291, in clean_me AttributeError: 'NoneType' object has no attribute 'TerminateRequest' Exception ignored in: <function PrototypeMultiProcessingReadingService.__del__ at 0x7f96eb668af0> Traceback (most recent call last): File "/Users//data/torchdata/dataloader2/reading_service.py", line 284, in __del__ File "/Users//data/torchdata/dataloader2/reading_service.py", line 296, in finalize File "/Users//data/torchdata/dataloader2/reading_service.py", line 291, in clean_me AttributeError: 'NoneType' object has no attribute 'TerminateRequest'
This is the common problem that Python
has already exited before __del__
is invoked. We can simply check if those variables/modules are None. If None
, we can skip cleanup
and return directly.
That's one of the options. Also requires join timeouts and errors propagation.
This can be closed as #837 has landed