Skip to content

Commit afec45c

Browse files
gireeshpunathilMylesBorins
authored andcommitted
fs: re-enable watch facility in AIX
On AIX, watch feature depends on AHAFS based Event infrastructure. While in principle the watch use case is same across platforms, there are subtle differences in the way AIX deals with this, with few behavioral changes (external). This commit addresses an assertion failure on folder watch, enabling the AIX code for watch feature which was masked under a macro, open up relevant test cases, skip tests which comes under the AIX limitation, and make the document changes as appropriate. Refs: #11094 Refs: #5085 PR-URL: #10085 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
1 parent a12cdf0 commit afec45c

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

doc/api/fs.md

+7
Original file line numberDiff line numberDiff line change
@@ -1752,6 +1752,13 @@ a new inode. The watch will emit an event for the delete but will continue
17521752
watching the *original* inode. Events for the new inode will not be emitted.
17531753
This is expected behavior.
17541754

1755+
In AIX, save and close of a file being watched causes two notifications -
1756+
one for adding new content, and one for truncation. Moreover, save and
1757+
close operations on some platforms cause inode changes that force watch
1758+
operations to become invalid and ineffective. AIX retains inode for the
1759+
lifetime of a file, that way though this is different from Linux / OS X,
1760+
this improves the usability of file watching. This is expected behavior.
1761+
17551762
#### Filename Argument
17561763

17571764
<!--type=misc-->

test/parallel/parallel.status

+1-8
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,7 @@ test-debug-signal-cluster : PASS,FLAKY
1919

2020
[$system==freebsd]
2121

22-
# fs-watch currently needs special configuration on AIX and we
23-
# want to improve under https://github.com/nodejs/node/issues/5085.
24-
# Tests are disabled so CI can be green and we can spot other
25-
# regressions until this work is complete
2622
[$system==aix]
27-
test-fs-watch-enoent : FAIL, PASS
28-
test-fs-watch-encoding : FAIL, PASS
29-
3023
#covered by https://github.com/nodejs/node/issues/3796
3124
# but more frequent on AIX ?
32-
test-debug-signal-cluster : PASS, FLAKY
25+
test-debug-signal-cluster : PASS, FLAKY

test/parallel/test-fs-watch-encoding.js

+9
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ const common = require('../common');
1414
const fs = require('fs');
1515
const path = require('path');
1616

17+
// fs-watch on folders have limited capability in AIX.
18+
// The testcase makes use of folder watching, and causes
19+
// hang. This behavior is documented. Skip this for AIX.
20+
21+
if (common.isAix) {
22+
common.skip('folder watch capability is limited in AIX.');
23+
return;
24+
}
25+
1726
common.refreshTmpDir();
1827

1928
const fn = '新建文夹件.txt';

0 commit comments

Comments
 (0)