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

Long running Shiny app starts printing lots of "nothing to compact" messages #4032

Open
Mkranj opened this issue Apr 22, 2024 · 1 comment
Open

Comments

@Mkranj
Copy link

Mkranj commented Apr 22, 2024

System details

Browser Version: N/A

Output of sessionInfo():

R version 4.3.3 (2024-02-29 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22631)

Matrix products: default


locale:
[1] LC_COLLATE=Croatian_Croatia.utf8 
[2] LC_CTYPE=Croatian_Croatia.utf8   
[3] LC_MONETARY=Croatian_Croatia.utf8
[4] LC_NUMERIC=C                     
[5] LC_TIME=Croatian_Croatia.utf8    

time zone: Europe/Zagreb
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets 
[6] methods   base     

other attached packages:
[1] shiny_1.7.4

loaded via a namespace (and not attached):
 [1] vctrs_0.6.5       zip_2.2.2        
 [3] cli_3.6.1         knitr_1.45       
 [5] rlang_1.1.1       xfun_0.42        
 [7] stringi_1.7.12    promises_1.2.0.1 
 [9] generics_0.1.3    xtable_1.8-4     
[11] glue_1.6.2        colorspace_2.1-0 
[13] htmltools_0.5.4   httpuv_1.6.11    
[15] scales_1.3.0      fansi_1.0.4      
[17] grid_4.3.3        munsell_0.5.0    
[19] tibble_3.2.1      ellipsis_0.3.2   
[21] fastmap_1.1.0     openxlsx_4.2.5.2 
[23] lifecycle_1.0.3   compiler_4.3.3   
[25] dplyr_1.1.4       Rcpp_1.0.10      
[27] pkgconfig_2.0.3   later_1.3.0      
[29] rstudioapi_0.15.0 digest_0.6.31    
[31] R6_2.5.1          tidyselect_1.2.0 
[33] utf8_1.2.3        pillar_1.9.0     
[35] magrittr_2.0.3    tools_4.3.3      
[37] gtable_0.3.1      mime_0.12        
[39] ggplot2_3.5.0    

Example application or steps to reproduce the problem

We've noticed this problem on different long-running apps. The steps to reproduce should be:

  1. Run shiny app
  2. Wait ~1 week
  3. the app will start printing "nothing to compact" multiple times a day

Describe the problem in detail

I've deployed my app on a server in a Docker container, running non-stop. When I went to check the logs after a while, I saw very, very many messages saying "nothing to compact", with no further info or timestamp. I'll paste the start of my docker logs results, with added timestamps:

2024-04-05T18:21:33.970831743Z Listening on http://0.0.0.0:8180
2024-04-11T12:16:15.265417805Z nothing to compact
2024-04-11T12:16:19.291261287Z nothing to compact
2024-04-11T12:34:33.017531754Z nothing to compact
2024-04-11T12:39:20.120900695Z nothing to compact
2024-04-11T12:51:56.971502461Z nothing to compact
2024-04-11T13:57:19.831936059Z nothing to compact
2024-04-11T13:57:23.710571177Z nothing to compact
2024-04-11T14:21:56.497685034Z nothing to compact
2024-04-11T17:22:20.045904747Z nothing to compact
2024-04-11T18:56:42.370072444Z nothing to compact
2024-04-11T19:55:10.521691846Z nothing to compact
2024-04-11T20:45:02.140067583Z nothing to compact
2024-04-11T20:45:05.813794484Z nothing to compact
2024-04-11T20:58:34.461086585Z nothing to compact
2024-04-11T21:50:29.171961874Z nothing to compact
2024-04-11T21:50:52.310731493Z nothing to compact
2024-04-11T21:52:24.740196825Z nothing to compact
2024-04-11T21:53:20.734851802Z nothing to compact
2024-04-11T21:57:19.845273506Z nothing to compact
2024-04-11T21:58:24.006256872Z nothing to compact
2024-04-11T23:35:51.417221759Z nothing to compact
2024-04-12T02:09:55.699545336Z nothing to compact
2024-04-12T02:09:58.940208598Z nothing to compact
2024-04-12T03:01:03.693630788Z nothing to compact
2024-04-12T03:06:29.795571128Z nothing to compact
2024-04-12T04:17:13.664731805Z nothing to compact
2024-04-12T04:18:24.941217665Z nothing to compact
2024-04-12T05:50:20.798255632Z nothing to compact
2024-04-12T05:50:26.335437903Z nothing to compact
2024-04-12T07:13:47.610819794Z nothing to compact
2024-04-12T07:34:44.146548640Z nothing to compact
2024-04-12T08:27:25.224126260Z nothing to compact
2024-04-12T09:16:32.922108451Z nothing to compact
2024-04-12T10:17:46.527567514Z nothing to compact
2024-04-12T10:54:12.674486614Z nothing to compact
2024-04-12T11:10:28.419305388Z nothing to compact
2024-04-12T11:13:58.205302718Z nothing to compact
2024-04-12T11:14:09.794770126Z nothing to compact
2024-04-12T11:35:27.862217942Z nothing to compact
2024-04-12T11:50:39.751735434Z nothing to compact
2024-04-12T11:55:35.197591502Z nothing to compact
2024-04-12T12:04:27.854571583Z nothing to compact
2024-04-12T13:29:36.264631435Z nothing to compact
2024-04-12T13:47:50.147907750Z nothing to compact
2024-04-12T14:26:20.364585829Z nothing to compact
2024-04-12T14:36:20.185322598Z nothing to compact
2024-04-12T14:55:10.201767601Z nothing to compact
2024-04-12T15:41:42.302015853Z nothing to compact
2024-04-12T15:42:08.973764603Z nothing to compact
2024-04-12T15:44:30.212286888Z nothing to compact
2024-04-12T16:02:27.533534098Z nothing to compact
2024-04-12T16:34:05.571633119Z nothing to compact
2024-04-12T16:51:29.913358905Z nothing to compact
2024-04-12T16:51:33.057073772Z nothing to compact
2024-04-12T19:23:52.806745888Z nothing to compact
2024-04-12T19:25:57.030202427Z nothing to compact
2024-04-12T19:54:31.737704318Z nothing to compact
2024-04-12T20:38:47.623482818Z nothing to compact
2024-04-12T20:58:12.829018650Z nothing to compact
2024-04-12T21:29:18.099410036Z nothing to compact
2024-04-12T21:29:43.454196520Z nothing to compact
2024-04-12T21:38:07.142978487Z nothing to compact
2024-04-12T22:07:06.105849197Z nothing to compact
2024-04-12T23:45:15.724528345Z nothing to compact

As you can see, the app was started on the 5th of April, and nothing more was logged for a few days (this is expected for my app). Then, from the 11th of April onwards this message was getting printed in, what seems to me, irregular intervals many times a day. The log is only a snippet, these messages keep getting printed to this day!
I've checked with a colleague who runs multiple applications via containers and he looked at one that hasn't been restarted in months - same thing happening there, completely different Shiny app.

Googling didn't reveal this to be an expected message, but I found what I think is the cause: this part of the cachem package which Shiny imports.
If you search "nothing to compact", you can see that a certain function prints that message. I'm not sure what the condition is or which part of Shiny this relates to.
Can you please see if something can be done about this, so the logs don't get filled up for no reason?

@wch
Copy link
Collaborator

wch commented Apr 22, 2024

That is interesting. It does seem likely that it's coming from the cachem package. It makes me wonder if there's a bug in that package.

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

2 participants