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

Attempt to fix issue 132 (corrupted data on reads) #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions gdrivefs/config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

IS_DEBUG = bool(int(os.environ.get('GD_DEBUG', '0')))
NO_THREADS = bool(int(os.environ.get('GD_NOTHREADS', '1')))
DO_LOG_FUSE_MESSAGES = bool(int(os.environ.get('GD_DO_LOG_FUSE_MESSAGES', '0')))
14 changes: 14 additions & 0 deletions gdrivefs/resources/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,20 @@ Just set the `GD_DEBUG` environment variable to "1"::
flags=0x00000011


Multi-threading FUSE
====================

It used to be that GDFS mounting used FUSE with no threads, only when running in
debugging-mode, and actually if not in debugging-mode, FUSE was always used
with threads.

Currently, using FUSE with threads corrupts data reads, once mounted. Then now
multi-threading is decoupled from debugging-mode, and by default set to no threads.

To enable threads back when mounting GDFS, just set the `GD_NOTHREADS` environment
variable to "0" (1 by default).


Troubleshooting Steps
=====================

Expand Down
2 changes: 1 addition & 1 deletion gdrivefs/resources/scripts/gdfs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def main():
auth_storage_filepath=args.auth_storage_file,
mountpoint=args.mountpoint,
debug=gdrivefs.config.IS_DEBUG,
nothreads=gdrivefs.config.IS_DEBUG,
nothreads=gdrivefs.config.NO_THREADS,
option_string=option_string)

if __name__ == '__main__':
Expand Down
4 changes: 2 additions & 2 deletions gdrivefs/resources/scripts/gdfstool
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _handle_mountpoint(args):
auth_storage_filepath=args.auth_storage_file,
mountpoint=args.mountpoint,
debug=gdrivefs.config.IS_DEBUG,
nothreads=gdrivefs.config.IS_DEBUG,
nothreads=gdrivefs.config.NO_THREADS,
option_string=option_string)

def main():
Expand Down Expand Up @@ -122,4 +122,4 @@ def main():
raise Exception("Invalid option.")

if __name__ == '__main__':
main()
main()