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

Mounts stop receiving inotify change events from host under 2.2.0.0 #5701

Closed
2 tasks done
ezk84 opened this issue Feb 5, 2020 · 7 comments
Closed
2 tasks done

Mounts stop receiving inotify change events from host under 2.2.0.0 #5701

ezk84 opened this issue Feb 5, 2020 · 7 comments

Comments

@ezk84
Copy link

ezk84 commented Feb 5, 2020

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID: 6E8A26E4-888A-421E-85DC-5D0CC352DA0E/20200205103309

Expected behavior

File change events from editing in the host should propagate to the container to enable tools like modd, nodemon or webpack to re-compile files in-container.

Actual behavior

Changes generally trigger recompilation but under the scenario of a subdirectory of a mount also being mounted on another container, change events stop propagating (in the example I outline below, it happens after about 20 seconds). Once that happens only re-starting the container works to restore desired behaviour (for a few seconds more).

Information

Reproducible. Only happens when /dir is mounted in one container and /dir/subdir is mounted in another. Both mounts exhibit the same behaviour.

After more investigation, I've seen that the order in which the containers start is relevant. I can reproduce it consistently when the container mounting the top-level directory starts after the one mounting the subdirectory.

I can reproduce in the official 2.2.0.42247 release as well as the private build (2.2.0.1.42579) that tries to address issues with the new bind mount implementation (from #5532, #5540). Interestingly, the contents of the file in the container reflect what I expect, but not the events that fire.

  • Windows Version: Microsoft Windows 10 Pro 10.0.18362 (Build 18362)
  • Docker Desktop Version: 2.2.0.42247 and 2.2.0.1.42579
  • Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: No

Steps to reproduce the behavior

Using git-bash shell

  1. mkdir -p dir/subdir
  2. touch dir/one.txt dir/subdir/two.txt
  3. Use the following docker-compose.yml:
version: "3"

services:
    dir:
        image: alpine:latest
        volumes:
            - ./dir:/dir
        working_dir: /dir
        command: sh -c "apk add inotify-tools && inotifywait -m one.txt"
        depends_on:
            - 'subdir'

    subdir:
        image: alpine:latest
        volumes:
            - ./dir/subdir:/subdir
        working_dir: /subdir
        command: sh -c "apk add inotify-tools && inotifywait -m two.txt"
  1. docker-compose up
  2. [another shell] I=0; while true; do I=$(( $I + 1 )); echo "Change $I!" | tee -a dir/one.txt; sleep 10; done
  3. Watch as the events in the log come in for a while in tandem with the Change n! lines in the other shell, and then stop.
  4. docker-compose exec dir tail -1 one.txt reveals all lines are there.
@ezk84 ezk84 changed the title Nested mounts sporadically stop receiving change events from host under 2.2.0.0 Nested mounts stop receiving inotify change events from host under 2.2.0.0 Feb 5, 2020
@ezk84 ezk84 changed the title Nested mounts stop receiving inotify change events from host under 2.2.0.0 Mounts stop receiving inotify change events from host under 2.2.0.0 Feb 5, 2020
@stephen-turner
Copy link
Contributor

Thanks for the report. I believe it is the same as #5530, so I'm closing it as a duplicate.

@mat007
Copy link
Member

mat007 commented Feb 5, 2020

As a matter of fact I’ve been running your reproduction steps against our latest release candidate build for about half an hour and I’m still seeing the events in the compose output!

@ezk84
Copy link
Author

ezk84 commented Feb 6, 2020

@mat007 is that RC build available for download?

@stephen-turner
Copy link
Contributor

@ezk84 It is now: see the comment I just posted on #5530.

@ezk84
Copy link
Author

ezk84 commented Mar 15, 2020

This issue was fixed for me after installing 2.2.0.4. Thanks for the hard work!

@stephen-turner
Copy link
Contributor

Great, thanks for the feedback, @ezk84.

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jul 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants