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

Emit, source map, and declaration cache in deno dir is racy across multiple processes #13302

Closed
dsherret opened this issue Jan 7, 2022 · 0 comments · Fixed by #15220
Closed
Assignees
Labels
bug Something isn't working correctly cli related to cli/ dir
Milestone

Comments

@dsherret
Copy link
Member

dsherret commented Jan 7, 2022

I've run into two caching issues while using deno the past two days where I was sure my code was ok, but I was getting type checking errors.

Upon closer inspection, our cache code is racy across multiple processes since the hash is stored in a separate file.

Also, looks like if you kill the process between these two statements then the emit won't be saved correctly and won't ever be reloaded until you change the source text:

deno/cli/emit.rs

Lines 458 to 459 in 12423e1

cache.set(CacheType::Version, &specifier, version)?;
cache.set(CacheType::Emit, &specifier, emit.data)?;

To solve this, we should store both the version hash along with each artifact in the same file. I've already started working on a fix. Edit: ended up storing an emit hash in the version file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly cli related to cli/ dir
Projects
None yet
1 participant