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

Incorrect behaviour when operation on databases that are replaced on-disk #333

Closed
criemen opened this issue Apr 18, 2020 · 3 comments · Fixed by #681
Closed

Incorrect behaviour when operation on databases that are replaced on-disk #333

criemen opened this issue Apr 18, 2020 · 3 comments · Fixed by #681
Labels
bug Something isn't working VSCode

Comments

@criemen
Copy link

criemen commented Apr 18, 2020

Describe the bug
I often use the VScode extension to run queries on databases produced by codeql test run.
If I run a query on a database, then run codeql test run, and then run another queries I get "Severe disk cache trouble (corruption or out of space)" exceptions.

To Reproduce

  1. add database generated by codeql test run to the VScode extension, run a query on it.
  2. Execute codeql test run again.
  3. Execute query again

Expected behavior
Second query should execute on the new database without exception

@criemen criemen added the bug Something isn't working label Apr 18, 2020
@dbartol
Copy link
Contributor

dbartol commented Apr 18, 2020

Thanks for the report. This is an issue we're aware of. The server that runs the queries keeps some files locked in the current database for performance reasons, but that doesn't work well when the database gets replaced out from under it. We'll look at how to notify the server to release those locks when regenerating the database.

@Cornelius-Riemenschneider Question: Are you running the tests from within the VSCode extension, or the CLI? It's currently broken in both scenarios, but it's easier for us to fix for tests run via the extension, where we already know which database we have locked.

The best workaround we have right now is:

  1. Switch to a different current database
  2. Run a trivial query on that database. The server won't release its lock on the old database until this happens.
  3. Re-run the test to regenerate the database
  4. Switch back to the test database

Obviously, this really slows down your workflow, so we'll try to solve this correctly.

@criemen
Copy link
Author

criemen commented Apr 18, 2020

Thanks for the workaround! Right now I've been reloading the window, but that takes about 20sec until everything is back, and it loses the previous results from the query view, so it's also not optimal.

Right now, I'm mainly running the CLI, because using the test runner is (as explained in #334 ) is slowing me down, too.

@aeisenberg
Copy link
Contributor

Likely related to #249.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working VSCode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants