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
File watching doesn't work on overlay filesystems #1201
Comments
Can you check what If I had to venture a guess, it'd be that there are specific inotify event masks that get on the good side of overlayfs. For example, inotifywait listens for IN_OPEN, libuv does not. |
It looks inotify might not be fully supported in |
@bnoordhuis here you go. The
When I run
I get this output. When I run
I get this output. |
Sorry, can I ask you to run |
Well, we certainly get quite a bit more information with |
Thanks. Libuv's event mask: inotifywatch's event mask: I suspect it's either the event mask or maybe epoll doesn't work for inotify overlayfs descriptors because the epoll_wait system call never reports events. inotifywatch uses select() and does receive events so it's probably the event mask. What happens when you apply this patch? diff --git a/src/unix/linux-inotify.c b/src/unix/linux-inotify.c
index 4708c05..8767f4d 100644
--- a/src/unix/linux-inotify.c
+++ b/src/unix/linux-inotify.c
@@ -218,16 +218,18 @@ int uv_fs_event_start(uv_fs_event_t* handle,
if (uv__is_active(handle))
return -EINVAL;
err = init_inotify(handle->loop);
if (err)
return err;
events = UV__IN_ATTRIB
+ | UV__IN_ACCESS
+ | UV__IN_OPEN
| UV__IN_CREATE
| UV__IN_MODIFY
| UV__IN_DELETE
| UV__IN_DELETE_SELF
| UV__IN_MOVE_SELF
| UV__IN_MOVED_FROM
| UV__IN_MOVED_TO;
|
Nope, it still times out, even with that patch. :( |
Okay, thanks. I think we'll have to chalk this up to bugs in the underlying platform. It doesn't look like there are easy workarounds in libuv. |
In my testing, this is fixed on kernel |
Thanks for following up, I'll close out the issue. Good to hear it works with a newer kernel. |
Hello there! I've run into a curious situation; file watching doesn't seem to work when run inside of a docker container that uses the new
overlay
oroverlay2
storage drivers. To demonstrate this, we just need to start up a recent docker daemon with theoverlay
oroverlay2
storage driver (e.g.sudo dockerd -s overlay2
) and use the followingDockerfile
:Building this
Dockerfile
fails on two tests, namelyfs_event_watch_file
andfs_event_watch_file_current_dir
, both of which timeout with no further output. Interestingly, tools such asinotifywait
still work, which I test with the followingDockerfile
:Running the resultant docker image, no matter the storage driver, results in a nice output such as the following:
I am running these tests on an Ubuntu 16.04 host with Docker
v1.13
installed, running a4.4.0
kernel. Using a storage driver ofaufs
works in all cases.The text was updated successfully, but these errors were encountered: