Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Investigation into ON_CHANGE actions during nodejs-express APPSODY_PREP #44

Open
kewegner opened this issue Oct 14, 2019 · 4 comments
Open
Labels
priority/low Low impact issue

Comments

@kewegner
Copy link
Collaborator

Description:
In some cases, particularly with appsody run for a clean docker for desktop install on Mac Os or when doing:

appsody init-nodejs-express
appsody run
The first time in a new directory on the Che-emulator environment

We will see:

[Container] Running APPSODY_PREP command: npm install --prefix user-app && npm audit fix --prefix user-app
File watch event detected for: FILE "test.js" REMOVE [/project/user-app/test/test.js]
File watch event detected for: FILE "test.js" CREATE [/project/user-app/test/test.js]

It appears that something in the npm commands may cause the watcher to think there is no test.js file (and due to the 1 event per watcher cycle setting we use, it could be more than just test.js)

FYI: The watcher.go code uses filepath.walk() routine to construct a map of files and then compares the map previously obtained on the poll to the current poll's map.

One short term fix that was tested for this would be to run APPSODY_PREP serially before starting the watcher, note this was brought up in another issue, whether we should watch during APPSODY_PREP.

Longer term, we need to investigate why the watcher/commands exhibit this behavior.

It did not appear to happen with Java Microprofile in the che emulator environment.

It seems to happen with nodejs-express on MacOS when there is a clean docker environment every time with the first appsody run. It has been seen a couple of times after long disuse of appsody init/followed by appsody run.

Note that subsequent appsody run's do not see the behavior.

@kewegner kewegner changed the title Investigation into ON_CHANGE actions during nodejs-express PREP Investigation into ON_CHANGE actions during nodejs-express APPSODY_PREP Oct 14, 2019
@kewegner
Copy link
Collaborator Author

For future investigation: We may want to observe if the PREP command (in the one particular circumstance with npm install) locks files or directories, which might cause the filepath.Walk used by the watcher.go code to skip over particular file(s), and thus it would appear that it was removed, and then re-added on the next polling scan.

@neeraj-laad neeraj-laad added the priority/low Low impact issue label Nov 22, 2019
@neeraj-laad
Copy link

We believe there is no impact to the user, but still needs some investigation.

@kewegner
Copy link
Collaborator Author

Note: If we do #34 It is likely this problem will disappear. It was only happening for node on APPSODY_PREP calls.

@kewegner
Copy link
Collaborator Author

kewegner commented Dec 2, 2019

Update #34 is now in PR #58 scheduled for milestone 12. When I run with a clean docker install (2.1.0.5) I do not see any ON_CHANGE actions during PREP for nodejs-express.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority/low Low impact issue
Projects
None yet
Development

No branches or pull requests

2 participants