Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listening to multiple tables causes server to crash #5806

Closed
jjbrosnan opened this issue Jul 18, 2024 · 2 comments · Fixed by #5808
Closed

Listening to multiple tables causes server to crash #5806

jjbrosnan opened this issue Jul 18, 2024 · 2 comments · Fixed by #5808
Assignees
Labels
bug Something isn't working python-server-side
Milestone

Comments

@jjbrosnan
Copy link
Contributor

Description

The merged listener crashes the server when listening to multiple tables.

Steps to reproduce

from deephaven.table_listener import merged_listen
from deephaven import time_table

t1 = time_table("PT2s").update(["X = i"])
t2 = time_table("PT3s").update(["Y = ii"])

def listener_function(updates, is_replay):
    data_added_t1 = updates[t1].added()
    data_added_t2 = updates[t2].added()
    print(data_added_t1)
    print(data_added_t2)

handle = merged_listen([t1, t2], listener_function)

Expected results

One of two things:

  • The code to work and print data added to each table when they tick.
  • An error message giving me some indication of what I didn't do right.

Actual results

The merged listener appears to run for a second or two, printing stuff. Then, the server crashes, and this is displayed:

Server shutdown: Exception while processing UpdateGraph notification

java.lang.NullPointerException: Cannot invoke "io.deephaven.engine.table.impl.QueryTable.satisfied(long)" because "this.result" is null
io.deephaven.engine.table.impl.MergedListener.propagateErrorDownstream(MergedListener.java:175)
io.deephaven.engine.table.impl.MergedListener.propagateError(MergedListener.java:154)
io.deephaven.engine.table.impl.MergedListener.handleUncaughtException(MergedListener.java:300)
io.deephaven.engine.table.impl.MergedListener$MergedNotification.run(MergedListener.java:368)
io.deephaven.engine.updategraph.impl.BaseUpdateGraph.runNotification(BaseUpdateGraph.java:711)
io.deephaven.engine.updategraph.impl.PeriodicUpdateGraph$ConcurrentNotificationProcessor.processSatisfiedNotifications(PeriodicUpdateGraph.java:836)
io.deephaven.engine.updategraph.impl.PeriodicUpdateGraph$NotificationProcessorThreadFactory.lambda$newThread$0(PeriodicUpdateGraph.java:1109)
java.base/java.lang.Thread.run(Thread.java:1583)

Additional details and attachments

If applicable, add any additional screenshots, logs, or other attachments to help explain your problem.

Versions

  • Deephaven: edge
  • OS: OS X
  • Browser: Chrome
  • Docker: 20.10.13
@jjbrosnan jjbrosnan added bug Something isn't working triage labels Jul 18, 2024
@jjbrosnan
Copy link
Contributor Author

Note that adding a try/except block in the listener function itself resolves the crash.

@rcaudy
Copy link
Member

rcaudy commented Jul 18, 2024

In general, you aren't supposed to throw uncaught exceptions in listeners. We probably need to wrap the listener callback to address that, but the issue is that we don't actually have a good way to signal that to the user. Maybe we need a secondary callback for "my listener blew up"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python-server-side
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants