You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[dbsp] Fix occasional panic on background task shutdown.
Sometimes, running the unit tests failed with:
```
panicked at crates/dbsp/src/circuit/runtime.rs:972:64:
cannot access a task-local storage value without setting it first
thread panicked while processing panic. aborting.
Aborted (core dumped)
```
The panic comes inside Drop for ImmutableFileRef, which attempts to
evict the file being dropped from the buffer cache. But
ImmutableFileRef doesn't have a reference to the BufferCache, it only
has a fn() -> Arc<BufferCache> that it can call to get a buffer
cache. This fn is actually Runtime::buffer_cache, which is what's
panicking.
The problem is that tokio task shutdown does not provide values for
task-local variables, which is what stores the buffer cache. This
commit avoids the problem by allowing the buffer cache to be
unavailable for Drop in ImmutableFileRef. This requires some code
refactoring so that the cache fn, and Runtime::buffer_cache(),
return an Option.
Signed-off-by: Ben Pfaff <blp@feldera.com>
0 commit comments