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

Exception in onWSClose causes uncaught exception #130

Open
wch opened this issue May 2, 2018 · 0 comments
Open

Exception in onWSClose causes uncaught exception #130

wch opened this issue May 2, 2018 · 0 comments

Comments

@wch
Copy link
Collaborator

wch commented May 2, 2018

Run this in one R session:

library(httpuv)
app <- startServer("0.0.0.0", 8000, list(
  onWSOpen = function(ws) {
    ws$onClose(function() {
      message("onClose start")
      Sys.sleep(10)
      message("onClose end")
    })
  }
))

And this in another:

library(websocket)
ws <- websocket::WebSocket$new("ws://localhost:8000/")
ws$onMessage(function(msg) cat(msg, "\n"))
ws$close()

In the first R session, press Ctrl-C within 10 seconds. It will print:

Error in execCallbacks(timeoutSecs) : c++ exception (unknown reason)
Calls: <Anonymous> ... serviceApp -> service -> run_now -> execCallbacks -> .Call

This is a minimal reproducible case of rstudio/shiny#1967 (comment)

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

No branches or pull requests

1 participant