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

Different configurations watched same file returned same instance #33123

Open
rickyes opened this issue Apr 28, 2020 · 1 comment
Open

Different configurations watched same file returned same instance #33123

rickyes opened this issue Apr 28, 2020 · 1 comment
Labels
fs Issues and PRs related to the fs subsystem / file system.

Comments

@rickyes
Copy link
Contributor

rickyes commented Apr 28, 2020

  • Version:
  • Platform: all
  • Subsystem: fs

Using two different configurations watched the same file, the second configuration will not take effect.

What steps will reproduce the bug?

  1. The process will exit.
const fs = require('fs');

fs.watchFile('a.js', {persistent: false} , () => {
  console.log(1)
});

fs.watchFile('a.js', () => {
  console.log(2)
});
  1. The Process does not exit.
const fs = require('fs');

fs.watchFile('a.js', () => {
  console.log(2)
});

fs.watchFile('a.js', {persistent: false} , () => {
  console.log(1)
});

How often does it reproduce? Is there a required condition?

unrequired condition.

What is the expected behavior?

Neither 1 nor 2 will exit the process.

What do you see instead?

  1. The process will exit.

Additional information

When watched, the StatWatcher instance is de-instanced by filename, and the same instance is returned each time the same file is watched.

@rickyes
Copy link
Contributor Author

rickyes commented Apr 28, 2020

The problem I found when I solved #33096 .

@targos targos added the fs Issues and PRs related to the fs subsystem / file system. label Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

No branches or pull requests

2 participants