-
Notifications
You must be signed in to change notification settings - Fork 441
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
writing large streams to bucket fails on OS X #196
Comments
It's probably a bug that this leaves the file system in an unusable state; I will take a look. But it's not surprising that your write doesn't work -- you are buffering 2-3 seconds times the bandwidth of copying from |
On OS X 10.11.6 with osxfuse 3.5.2 I'm able to reproduce a hang before returning to the shell after hitting ctrl-C on
This all seems as expected (or at least the best we can do) with the sole possible exception of a hung inode lookup blocking further ops from being received for other inodes. But it appears that's happening in the kernel, presumably due to some kernel-side lock being held on the directory wile listing it, so there's not much that can be done. @chrishiestand: can you confirm what exact OS X and osxfuse versions you are running, and that the file system truly stops working even after |
The version of gcsfuse in the first report was 0.19.0. I've upgraded so it is now Sorry for the delayed response. Perhaps a pipe from /dev/zero was a bad example, though I'm not sure why that would be substantively different than copying a large file. I believe a pipe should block when the write buffer is full and so gcsfuse shouldn't have to worry about doing that OS task? I was just using it as a reproducible case where large piped uploads failed (though the source of the stream where I hit this error was a process reading from a remote source and not /dev/zero). In any case, surely this utility should be able to handle an upload of a file the size of 1GB.
This seems to be the crux of the problem:
With
|
It can and does handle 1 GB file writes. How fast is your upstream connection? You should see a transfer of ~1 GB, then everything works again. As I said above, this appears to be a lock in the kernel held for the duration of the file flush, so there's not really anything I can do about it as far as I can tell. |
The speed of my connection shouldn't be a significant factor as long as I'm on something better than dialup right? In any case I've got about 15Mbs up / 3Mbs down here (I nearly cried when Google Fiber expansion paused); even so I'd imagine that shouldn't be the cause of this issue. The copy seems to go quite well with these lines scrolling quickly:
And then it pauses after these:
I don't understand why the operations change from writing the file to GetInodeAttributes() "stat'ing" the file. So then would you think this is a kernel bug? A MacOS Fuse bug? |
All of the Can you help me understand from your point of view what you think is going wrong here? I'm a bit lost. |
Ah, yes that makes sense. I didn't look too closely and I thought that the writes were being immediately flushed. I'm unfamiliar with the codebase and what's going on under the hood, so I haven't a clue what's going wrong, I was just trying to understand what you thought was going wrong :-). So it looks like we are trying to upload the entire file in one request? How come we aren't flushing smaller chunks of the file at a time? |
One request or many doesn't really make a difference -- it's going to take ~9 minutes either way. Multiple requests actually make this slightly slower. |
What I wrote wasn't very clear sorry. The problem seems to be that something is triggering a 60s timeout. What is?
I mean, why aren't we flushing at smaller increments so that we're not hitting a timeout issue? As a counter-example, for example, if I'm |
I assume this is osxfuse's The reason that the GCS object is only created when the file is flushed is that GCS objects can't be randomly written to, but files can. So gcsfuse may see you write 100 MB to an object, and then go back and change the first byte. If that were to happen, it would have to write an extra 100 MB just to overwrite the first byte. In theory if gcsfuse could tell that you had opened the file in an append-only mode it could write to gcsfuse incrementally as it received writes from the kernel. But there are other issues with this:
|
That's the timeout! Isn't it possible to measure upload speed and calculate chunk sizes to optimize for bandwidth but not timeout? There could be a cli flag set to disable chunking for those on a very fast network (e.g. GCE) or small files; or conversely to enable chunking for large uploads/slow connections. Since I won't be submitting a PR for this anytime soon I'll understand if this is a "won't add" feature. I guess the next best thing we can do is document the timeout problem for large files. I can confirm that using mount option Thanks for all your time @jacobsa, I appreciate it. |
I don't want to get into the business of heuristics to guess how long things will take, since that is error-prone and makes the system's behavior harder to reason about. In this case the software using the file system can implement that behavior on top, by regularly flushing the file after the desired amount of data is written. I understand that's not a great answer for command-line use though. I'll call this issue out in the documentation; thanks for that idea. |
output:
expected output:
actual output:
At this point the mount is stuck and must be force unmounted in order to try again:
OS X 10.11 (El Capitan)
The text was updated successfully, but these errors were encountered: