multiconcurrent users cause app crash

97 views
Skip to first unread message

Benoît Lancelin

unread,
Feb 19, 2015, 3:04:41 AM2/19/15
to shiny-...@googlegroups.com
Hello,
I have some trouble sharing applications with a shiny server open source version.
If only one user launch the app, it works well. If a second user launch the app (on the same computer with another browser or on another computer), the first user app crashes giving the following error : "The application exited unexpectedly. read ECONNRESET"
(it seems that all the connections to the app use the same port)

This problem occurs on very simple apps :

ui.R
shinyUI(fluidPage(
  mainPanel(
    tags$hr(),
    helpText('Test'),
    tags$hr()
  )
))

server.R
shinyServer(function(input, output, session) {
  session$onSessionEnded(function() {
    stopApp()
  })
})

I was told that it was because I share parts of the app out of the app folder but this example doesn't use any extra files.
Thanks in advance for any piece of advice.


Joe Cheng

unread,
Feb 19, 2015, 4:04:53 AM2/19/15
to Benoît Lancelin, shiny-...@googlegroups.com
You're calling stopApp(), which stops the entire Shiny app for all users--that's what it's designed to do. You should never call stopApp in a Shiny Server scenario (at least, I can't think of when it could possibly be useful)--it's intended to be used for Shiny apps that are used directly from an R console, by an R user who can make use of the return value from runApp.

Shiny Server automatically stops Shiny apps a few seconds after the last user leaves, and will automatically start it the next time someone tries to connect. So your shinyServer function for this example should have a totally empty function body.

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/f3a14c97-11d3-449c-b9bf-9f89ac7f5f78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages