Common problems when debugging Deephaven
This guide covers two Deephaven-specific reasons the debugger doesn't stop at a breakpoint in your code: table operations that evaluate lazily, and ticking-table updates that never run because a script that starts its own server exits first. Neither is caused by your debugger setup.
The examples use PyCharm with pip-installed Deephaven, but these problems and solutions apply to all IDEs and, except where noted, all installation methods. Use PyCharm 2024 or later. Debugging Deephaven with PyCharm 2023 has known problems.
Lazy evaluation of some table operations
Some Deephaven table operations, including view, update_view, and lazy_update, use lazy evaluation. Deephaven doesn't compute a column's values until something reads them, for example a downstream operation or opening the table in the Deephaven web IDE. Until then, code in the formula never runs, so the debugger doesn't hit breakpoints in it.
This matters most when debugging user-defined functions called in lazy table operations. Take this example, which sets a breakpoint on the first line of udf:
Note
The -DAuthHandlers=io.deephaven.auth.AnonymousAuthenticationHandler argument turns on anonymous authentication, so you can open the Deephaven web IDE without a pre-shared key. The debugger doesn't need it. With it on, any client that can reach port 10000 can run code without a password, so use it only on a machine and network you trust.
In this case, the debugger does not reach the breakpoint, because update_view does not evaluate udf. The script prints Server started on port 10000 and then finishes without pausing at the breakpoint.
To force evaluation for debugging purposes, use select. Replace the last two lines of the script with:
The debugger now stops at the breakpoint inside udf:

Ticking tables when your script starts the server
Your script may start the server itself with deephaven_server.Server, as in the pip-installed setup or the embedded-server setup. That server runs only as long as the Python process does, so it stops when the script reaches its last line.
Deephaven applies ticking table updates on its own update threads, separately from your script's main thread. If the process exits before the next update, the code that update would call never runs.
This doesn't affect code run in the web console of a separately running server, such as one run in Docker, because that server keeps running after the code finishes.
This problem most often shows up when you debug a user-defined function (UDF) called from a ticking table operation:
Whether the debugger stops depends on timing. If the time table already has rows when t_new is created, the initial update calls udf on the main thread, and the debugger stops there once. Calls for rows added later happen on Deephaven's update threads. The script ends right after creating t_new, so those calls usually never run, and the debugger never stops for them. To remedy this in a script that starts its own server, keep the process alive with a call to time.sleep at the end of the script:
The debugger now stops at the breakpoint in udf, on one of Deephaven's update threads. Deephaven registers its update threads with the debugger, so the thread list shows a Deephaven thread rather than MainThread. In this screenshot, it is Dummy-8:
