Fix two bugs affecting persistent stubs#6840
Conversation
When using persistent stubs, it turns out that a stub produced by `ctx.restore()` holds a self-reference which can lead to a cyclic self-cancellation issue when tearing down the IoContext. We were deferring destruction of the worker, but not unlink(). We need to defer both.
If any externals are present, clearExternalsIfPresent() will execute a new query which causes the previous `query.changeCount()` to return the wrong value, because the change count comes from a SQLite API that reports from whatever query ran last. Arguably, the `changeCount()` method is a bad interface but I've left fixing it as a TODO.
|
Good — This is a clean, correct fix. Both bugs are legitimate and the fixes are well-structured. The code is correct and I don't see actionable issues. LGTM |
Merging this PR will degrade performance by 12.18%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Would like to get this into a workerd release as it is blocking Gadgets local development.