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

File modification monitoring doesn't work with 9p #112

Open
blubber opened this issue Apr 4, 2016 · 6 comments
Open

File modification monitoring doesn't work with 9p #112

blubber opened this issue Apr 4, 2016 · 6 comments

Comments

@blubber
Copy link

blubber commented Apr 4, 2016

The Django development server has an auto-reload feature, where it monitors the source code for changes and restarts the webserver if required. I tried to run the Django dev server in a docker container on top of xhyve, but the auto-reload feature kept continuously reloading the source code (i.e. it was detecting some kind of change continuously.) This was using a 9p shared drive.

When I run the exact same Django project in docker on top of xhyve using the NFS shared drive it works as expected.

I chacked if the system time inside the machine was OK, and it was. Sorry I don't have more info at this point.

Edit: the NFS shared drive seems to be extremely slow to notice modifications.

@Strech
Copy link

Strech commented Apr 12, 2016

I have another one problem with virtio-9p. Some files become invisible for all commands. But they still available for ls, but if I do copy <folder> they will not copy.

And another one confusing thing

mounted folder

@jceel
Copy link

jceel commented Jun 1, 2016

Hi, I just spotted that issue. There was indeed a bug with missing directory entries and it's fixed now.

@zchee
Copy link
Member

zchee commented Jun 1, 2016

@jceel Thanks reply. I'm surprised 😮
Now I have not been able to maintain this project, but will try latest version later.

thanks

@georgecrawford
Copy link

Hi.

I think I might be suffering from a similar issue as reported by @Strech. I'm using docker-machine-driver-xhyve with minikube:

docker-machine-driver-xhyve version 0.3.1
minikube version: v0.14.0
OS X 10.12.2

On creating a fresh VM (minikube start --vm-driver=xhyve), I can see my /Users directory mounted at the same location on the VM (minikube ssh). However, I've encountered a directory where the file count is wrong:

ls -l /Users/george/[MYDIR]/ | wc && minikube ssh -- ls -l /Users/george/[MYDIR]/ | wc
      90     803    8375
      88     785    8988

I can't see any logic as to the mismatch - if I shorten the file names, I get the same count. Below c.70 files, the counts tend to be the same, but above that, they get 2 out from each other. Two files (nothing special about them) are simply not listed on the VM.

Please let me know if you need any further information.

@julienbachmann
Copy link

julienbachmann commented Apr 24, 2017

The original issue title is File modification monitoring doesn't work with 9p. And i think there is an issue with that (so could you open other issues for other problem).

When you mount a folder in your container then modification time seen from python code are wrong.
Here is an example:

folder /srv/server is a p9 mounted folder. If I launch a python console:

bash-4.3# python
Python 3.4.6 (default, Mar  3 2017, 23:29:12) 
[GCC 5.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.stat('/srv/server/org_management/user.py').st_mtime
1492764660.2692168
>>> os.stat('/srv/server/org_management/user.py').st_mtime
1492764660.4962165
>>> os.stat('/srv/server/org_management/user.py').st_mtime
1492764660.0202165

You can notice that the fraction part of the time is always different.
If I do that on a file that is not from a mounted folder

bash-4.3# python
Python 3.4.6 (default, Mar  3 2017, 23:29:12) 
[GCC 5.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.stat('/srv/manage.py').st_mtime
1470231158.0
>>> os.stat('/srv/manage.py').st_mtime
1470231158.0
>>> os.stat('/srv/manage.py').st_mtime
1470231158.0

In this case you see that time is always .0

So I think there is an issue with the stat of mounted folder. Then if you try to use a mouted folder for development your code will always reload in loop :-(

My host is a Mac OS X 10.11.6 and I am runningminikube version: v0.17.1 and docker-machine-driver-xhive 0.3.2

@justincormack
Copy link

The 9p protocol does not support modification notifications, so this will never work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants