-
Notifications
You must be signed in to change notification settings - Fork 541
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
[State] Disable WAL when running on WSL #1574
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix @romilbhardwaj! Could we have a TODO comment to note that the fix may cause the database locked problem on the WSL?
Just tested on mac OS 12.6 with the following:
(sky-dev) ➜ sky-experiment-dev (disable_wal) python ✱
Python 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:05:47)
[Clang 12.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from sky.utils import common_utils
>>> common_utils.is_wsl()
False
Seems working!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The snippet failed 0 out of 30 times for me on Mac (as expected, as this PR is a no-op for Mac).
|
||
def is_wsl() -> bool: | ||
"""Detect if running under WSL""" | ||
return 'microsoft' in platform.uname()[3].lower() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work on my machine:
>>> uname().release
'4.4.0-19041-Microsoft'
Thanks folks! Merging now |
We enabled write ahead logging for state.db in #1513, but it breaks compatibility for WSL (
sqlite3.OperationalError: locking protocol
; see wsl issue), particularly when running tests.This PR puts a check for WSL before enabling WAL on
state.db
.Note that this "fix" is a band-aid. We may still see issues when WSL users try to access state.db concurrently from multiple processes.
This PR does not touch WAL for
skylet_config.db
.Tested (run the relevant ones):
bash tests/run_smoke_tests.sh using_file_mounts
) on WSL to ensure fix works