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

Errors in event handlers cause server to crash #401

Closed
rmorshea opened this issue Jun 16, 2021 · 2 comments · Fixed by #402
Closed

Errors in event handlers cause server to crash #401

rmorshea opened this issue Jun 16, 2021 · 2 comments · Fixed by #402

Comments

@rmorshea
Copy link
Collaborator

The flow:

  1. Event handler onClick called
  2. Event handler dumps an event (dict) into an anyio memory_stream's send_stream
  3. Event handler done
  4. Separate anyio-spawned thread picks up the event (inside an async for)
  5. Event is executed, exception hit
  6. Stack trace posted above happens

The rest of the application (the event queue) is responsive when this happens and I'm able to dispatch/process events via non-idom means.

My fix was to add a try/catch around step 5. The problem is resolved but the stack trace was getting swallowed somehow from the exception in event execution so it took a while to realize it was my code at fault.

Hopefully that all makes sense.

Originally posted by @brentbaum in #392 (reply in thread)

@rmorshea
Copy link
Collaborator Author

Adding a try/except here and logging the error rather than raising it should fix the issue: https://github.com/idom-team/idom/blob/main/src/idom/core/layout.py#L108

@rmorshea
Copy link
Collaborator Author

A fix for this will make it into the upcoming 0.29.0 release this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant