xiongxu / s3fs

Automatically exported from code.google.com/p/s3fs
GNU General Public License v2.0
0 stars 0 forks source link

git init hangs the s3fs file system #129

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. mount a bucket
2. cd into the mount
3. git init

What is the expected output? What do you see instead?

the "git init" command never returns and the mount is now inaccessible. I 
haven't found a way to recover from this other than to reboot.  

A little bit of debug so far:

There's a rename operation that occurs during this process

.git/HEAD.lock -> .git/HEAD

Inside of s3fs_rename, there is a "stat" call. Upon this call, that is where 
the hang occurs.

HEAD.lock and HEAD are normal files. That is, it is not a directory.  Doing 
this operation "by hand" does not expose the bug.

Original issue reported on code.google.com by dmoore4...@gmail.com on 27 Nov 2010 at 7:26

GoogleCodeExporter commented 9 years ago
I don't know why, but "git init" doesn't hang on CentOS.  Although that
all well and good, doing a "git add ." does make it hang.  Again, it's a
rename operation:

...
mkdir[path=/.git/objects/df][mode=509]
getattr[path=/.git/objects/df]
getattr[path=/.git]
getattr[path=/.git/objects]
getattr[path=/.git/objects/tmp_obj_TKEeoe]
getattr[path=/.git/objects/df/e535dbf809daace234baf32fee20ae4753e844]
link[from=/.git/objects/tmp_obj_TKEeoe][to=/.git/objects/df/e535dbf809daace234ba
f32fee20ae4753e844]
getattr[path=/.git/objects/df/e535dbf809daace234baf32fee20ae4753e844]
rename[from=/.git/objects/tmp_obj_TKEeoe][to=/.git/objects/df/e535dbf809daace234
baf32fee20ae4753e844]

I guess that this boils down to directory renames not working.

Having git working on s3fs mounts presents an attractive usage model --
one can do a "Drop Box" sort of thing with s3fs/git (that is,
sharing/synchronizing data across several machines, especially laptops,
whose network connectivity isn't always on).

Original comment by dmoore4...@gmail.com on 29 Nov 2010 at 2:39

GoogleCodeExporter commented 9 years ago

Original comment by dmoore4...@gmail.com on 19 Dec 2010 at 1:19

GoogleCodeExporter commented 9 years ago
Resolving the directory rename issue did not resolve this issue on Ubuntu 10.10 
(other platforms have not been tested).  

This may be a FUSE bug. A call for help has been posted on the fuse developers 
mailing list:

http://sourceforge.net/mailarchive/forum.php?thread_name=4D105B56.3010900%40sunc
up.net&forum_name=fuse-devel

Original comment by dmoore4...@gmail.com on 21 Dec 2010 at 5:22

GoogleCodeExporter commented 9 years ago
Thanks to Ben for finding a fix for this issue. Resolved with r310

The stat() in the s3fs_rename() was changed to fstat(). With this change, the 
hang on git init is resolved. This has been tested on several platforms.

However, git woes are not completely resolved. When git init is executed on a 
not-so-well connected machine there can be issue with the .git/config file. The 
config file is sometimes truncated:

fatal: bad config file line 4 in /home/mooredan/misc.suncup.org/.git/config

...but a subsequent git init will be successful

On a well connected machine, like on EC2, git init is very reliable.

This is a sighting and a new issue will be opened, but this one is fixed.

Original comment by dmoore4...@gmail.com on 10 Feb 2011 at 3:27