deephaven / deephaven-core

Deephaven Community Core
Other
249 stars 79 forks source link

Uncaught exceptions in `submit_task` are not logged #5192

Open mofojed opened 6 months ago

mofojed commented 6 months ago

Description

If you call submit_task with a function that raises an error, the error seems to get swallowed up and is not logged anywhere. This makes it difficult to debug, or even be aware that a problem has occurred.

Steps to reproduce

  1. Run the following snippet:
    
    from deephaven.server.executors import submit_task

def my_task(): print("XXX my_task start") raise NotImplementedError("XXX my_task raising an error")

submit_task("concurrent", my_task)



**Expected results**

1. `XXX my_task start` being printed out, and then an exception logged

**Actual results**

1. Just `XXX my_task start` gets printed out. No exception is logged.

**Additional details and attachments**

![image](https://github.com/deephaven/deephaven-core/assets/4505624/da963fcd-15a0-4796-af94-17a5ebc53243)

Engine Version: 0.33.0-SNAPSHOT
Web UI Version: 0.63.0
Java Version: 11.0.21
Barrage Version: 0.6.0
Browser Name: Chrome 121
OS Name: Linux
mofojed commented 6 months ago

It should actually probably kill the server instead of just log an error, as there's no guarantee the state isn't broken at that point. Submitters of tasks can decide to try/catch the error if it's not catastrophic to the state of the system.