Cancelling big data download with Firefox


I am working to enable downloading big data frame from a shiny app running on Shiny server pro on CentOs 7. I created a download button and I have tried it with a large data frame (more than 500MB). It took about 3 minutes to display the confirmation message (using Firefox). Once I confirmed the download it worked however if canceled, I was disconnected from the server. Looking at the log file I got the following message:

Error: C stack usage 854680375172 is too close to the limit
Execution halted

Cancelling download for a small size file did not disconnect from the server. I am thinking to increase the ulimit -s size but I am not sure that is the right solution since I don’t have any recursive calls.

I also worked on another faster solution pre-zipping the data (now 240 MB) however I still have the issue when cancelling the download with Firefox causing a disconnection from the server.

I appreciate your help or any advice to solve my issue.



Here below a reproducible example. I ran on my laptop (mac) and I have no problem when cancelling the download with Firefox or Chrome however doing the same action on the CentOS server with shiny server pro causes a disconnection from the server. Any thoughts?





ui <- fluidPage(

downloadLink("downloadData", "Download")

server <- function(input, output) {

output$downloadData <- downloadHandler(
filename = function() {
paste("data_CCLE-Broad-MIT_xsq_", Sys.Date(), ".zip", sep="")
content = function(file) {
myfile = ""
## file size is 244.6 MB
## you can replace this with another big file

  if (file.exists(myfile)) file.copy(myfile, file) 


Run the application

shinyApp(ui = ui, server = server)

Installing the latest version for packages: shiny, httpuv and later solved my issue.
Thanks to the Rstudio support team

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.