-
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
gcsfuse hangs when called from systemd startup #189
Comments
Sorry, I'm far from an expert on systemd so I fear I'm a bit ill-equipped here. Are you able to do anything like send You may also try adding printf debugging to the code for |
I modified
As you can see, the Sending a
Any other thing I could try to help debug the issue? |
I notice this is automount. See this discussion, where @ashamza identified a deadlock. Are you able to try the code workaround we discussed there? |
I'm not exactly sure which workaround to try or how. I added printfs before and after the call os
In fact, even if I remove the call entirely, (Also, just for the record, I'm trying to automatically mount the FS on boot. systemd also supports "on-demand" automounting, where it will defer the mount until the first time the directory is accessed, but this is not what I'm trying to do.) |
Ah interesting. The workaround I meant was removing the call entirely (on Linux). So apparently that's not the issue. To clarify, because it's hard to tell for sure from your output: is the gcsfuse process still running? It's not in a stopped state or something like that? Does |
Yes, it's still running. (I'm still running it with This gist contains the contents of |
Thanks for the nice gist. A few things:
|
Sorry, I did not realize that. Here's a new gist that should contain the stack of all threads when gcsfuse is started after boot (
I don't know about
Both |
Thanks, that's really helpful. I wonder if the problem here is root though -- I know that fuse treats it specially (see for example the |
Okay, now I'm confused. I added the To work around this, I converted the I didn't find a simple way to make systemd not pass |
Sorry for the slow response. Unfortunately knowing nothing about systemd, I'm also not sure. :-/ |
Systemd is different than what I am doing but I tried to do a systemd configuration and looks like systemd is working so I am wondering why it isn't working with @AssortedParrot. I have two questions to @AssortedParrot:
I have a workaround that makes automount works which is using a wrapper to call gcsfuse with When I first tried automounting it used to hang in |
@AssortedParrot: what's your current understanding of this issue? Do you think it is a gcsfuse bug? |
@AssortedParrot I'm about to test a patch that was just merged. I found the same problem that |
@AssortedParrot I think I now see what your problem is. I just tested the systemd service file I created to integrate with the patch I submitted. Now I am getting an error around the @jacobsa I see a few issues with the
Do you have any thoughts around these changes? I'm happy to try to help implement some of them. |
(Please bear with my dumb questions. I don't know the first thing about systemd, and only a little about mount helpers.)
|
|
Again I'm confused—why is It seems like it would be possible and pragmatic to write a wrapper which, when run as root, changes to the correct user and then runs |
|
Sure. But you could have a It's feeling to me like this issue belongs in the systemd bug tracker, with a workaround for systemd distributed separately until the bug is fixed. |
To be fair, I also believe this belongs in the systemd bug tracker. However I decided to try to work around this on this end because the systemd developers are notoriously disagreeable according to many of the people who have worked with them. I think the work around you propose sounds reasonable and I am willing to reach out to the systemd people to see if they are willing to change this but my expectation is that this work around will be the only way of integrating with systemd moving forward. |
Right, that's sad. :-( What I'd like to happen here; please tell me if you agree:
|
@jacobsa That sounds like a good idea to me. It might take me a bit to get around to this but if you would like to assign this issue to me on Github just so I have a reminder on my account that I need to do this, that would be great. Thanks! |
I must admit to being a GitHub simpleton. When I click on the gear next to assignees I see a list of people including myself and AssortedParrot, but not you. If I type "jbaublitz" and hit enter, nothing at all happens. Am I missing something? |
Hmmmm... I have never done this before so I might need to have access to the repo. If that is the case, I will just do it the "old fashioned" way and make a note for myself. :) Once I create the repo, I will put a link to it here for bookkeeping purposes. Thanks! |
|
Thanks. To be clear, I'm not recommending you fork the existing project. I think this just needs to be a simple tool that calls into |
Whoops. I was going to do that in the existing project for integration purposes but I can create a separate project that just contains that code if that is preferable. I'll fix that. |
I have a created a systemd service to mount a Google Cloud Storage volume via gcsfuse on boot. The trick to avoiding the "lock on boot" problem is to ensure that it runs after It has worked for me on two Google VM instances so far. Use it at your own risk; I recommend setting a root password on the VM and enabling the serial console before rebooting, in case this service locks up your instance on boot. |
@jacobsa I realized I never followed up on this. Sorry to have dropped the ball. Currently I am using a @craigafinch I am curious how you're getting forking working. That never seemed to work for me. See above for the exact behavior. In any case I will try that again just to verify. |
@jbaublitz I provided my systemd service file as a link to a gist in a previous comment. Do you have any other specific questions? |
@craigafinch Thank you for your contribution. I took a moment to verify and it does indeed work in the current version of systemd and gcsfuse. @jacobsa I can no longer reproduce the behavior that I saw with |
Great, thanks for the update. I'll close this then; let me know if anything comes up. |
Automatically mounting via
/etc/fstab
fails, so I set up a systemd mount unit that looks like this:gcsfuse-wrapper
is a wrapper script that strips away the-n
option that/sbin/mount.gcsfuse
does not understand. For debugging, it also waits 15 seconds before actually calling/sbin/mount.gcsfuse
to ensure that the network is actually up.When systemd tries to mount the unit during startup, it hangs.
After a while, systemd will timeout and terminate the process. If I issue a
systemctl restart var-gcs.mount
, it will work just fine and properly mount the bucket.Unfortunately, I was unable to make
/sbin/mount.gcsfuse
accept the--debug_*
options, so I cannot provide more detailed information.What could be causing this, and how can I work around it? Or is there a better way to automatically mount the bucket on boot?
The text was updated successfully, but these errors were encountered: