ccache icon indicating copy to clipboard operation
ccache copied to clipboard

Cache can't be garbage collected

Open ebonetti opened this issue 8 years ago • 2 comments

Goroutine (associated with cache worker) prevent cache from being collected. In my opinion there should be a way to stop it. Alternatively, this fact should be documented.

Keep up the good work, Enrico

ebonetti avatar Jul 22 '15 13:07 ebonetti

Are you ok with the cache being unusable once Stop is called? Is panic'ing a little extreme or acceptable?

Consider: https://github.com/karlseguin/ccache/commit/bfa769c6b6c794afa640d7259ebc270c7da037a7

karlseguin avatar Jul 23 '15 14:07 karlseguin

Edited: there is a big problem with "deletables" channel: goroutines waiting to pass values are blocked.. In "worker", just before exiting goroutine, the Cache should be cleared (enforcing user to stop using it) and then close "deletables". This way it panics on both channel on a send attempt, but in my opinion panicking isn't right.. Enrico

ebonetti avatar Jul 23 '15 17:07 ebonetti