Skip to content

Commit 2ecc162

Browse files
committed
fix: handle exceptions in Daemon threads
1 parent a4708d4 commit 2ecc162

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
0.6.1
2+
- fix: handle exceptions in Daemon threads
23
- fix: display all resources of a dataset for which the SHA256
34
check failed (opposed to just the first)
45
- setup: bump dclab from 0.34.6 to 0.35.0

dcoraid/upload/queue.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,17 @@ def run(self):
304304
continue
305305
# Perform daemon task
306306
task = getattr(job, self.job_function_name)
307-
task()
307+
try:
308+
task()
309+
except BaseException as e:
310+
# We do not care if this step fails.
311+
# TODO: If we get an exception here, we should
312+
# probably log it. For now, issue a warning:
313+
warnings.warn(
314+
f"Experienced an exception in {self.__class__} "
315+
+ f"with job {job}: {e}"
316+
)
317+
pass
308318

309319

310320
class CompressDaemon(Daemon):

0 commit comments

Comments
 (0)