Flow: Flow can get stuck in a loop rechecking after file change

Created on 12 Jan 2020  路  6Comments  路  Source: facebook/flow

I've only noticed this in 0.115.0 but it could be older (I used to get 'hangs' with no logs when webstorm was sending lwp requests at the same time as saving files - I now disable webstorm asking flow anything which fixes the hangs but now I get these occasional errors).

platform: windows :(

I use prettier - so generally I save a file, then prettier formats it and saves it again - this results in the file being changed whilst flow is processing the first file change - this is probably what aggrevates the bug.

This happens for me 1 time in 5, so I guess it is a timing issue.

logs:

[2020-01-12 09:27:38.643] recheck 1 modified, 0 deleted files
[2020-01-12 09:27:38.643] modified files:
[2020-01-12 09:27:38.643] 1/1: C:\git\Project\src\otherFileChanged.js
[2020-01-12 09:27:38.643] Parsing
[2020-01-12 09:27:38.961] Resolved requires changed
[2020-01-12 09:27:39.567] Canceling since a recheck is needed
[2020-01-12 09:27:39.573] Canceling progress 1/12
[2020-01-12 09:27:39.575] Canceling progress 2/12
[2020-01-12 09:27:39.576] Canceling progress 3/12
[2020-01-12 09:27:39.596] Canceling progress 4/12
[2020-01-12 09:27:39.597] Canceling progress 5/12
[2020-01-12 09:27:39.598] Canceling progress 6/12
[2020-01-12 09:27:39.599] Canceling progress 7/12
[2020-01-12 09:27:39.602] Canceling progress 8/12
[2020-01-12 09:27:39.602] Canceling progress 9/12
[2020-01-12 09:27:39.604] Canceling progress 10/12
[2020-01-12 09:27:39.605] Canceling progress 11/12
[2020-01-12 09:27:39.605] Canceling progress 12/12
[2020-01-12 09:27:39.605] Recheck successfully canceled. Restarting the recheck to include new file changes
[2020-01-12 09:27:39.605] recheck 1 modified, 0 deleted files
[2020-01-12 09:27:39.606] modified files:
[2020-01-12 09:27:39.606] 1/1: C:\git\Project\src\otherFileChanged.js
[2020-01-12 09:27:39.606] Parsing
[2020-01-12 09:27:39.859] Resolved requires changed
[2020-01-12 09:27:40.579] Re-resolving directly dependent files
[2020-01-12 09:27:40.696] Resolved requires are unchanged
[2020-01-12 09:27:40.696] Recalculating dependency graph
[2020-01-12 09:27:40.916] recheck 5 dependent files:
[2020-01-12 09:27:40.916] to_merge: Focused: 1, Dependents: 5, Dependencies: 0
[2020-01-12 09:27:40.916] Calculating dependencies
[2020-01-12 09:27:40.916] Merging
[2020-01-12 09:27:41.152] Merge skipped 3 of 6 modules
[2020-01-12 09:27:41.152] Done
[2020-01-12 09:27:41.156] Checked set: Focused: 7953, Dependents: 0, Dependencies: 0
[2020-01-12 09:27:41.161] Running a serial workload
[2020-01-12 09:27:41.161] Request: status
[2020-01-12 09:27:41.170] Status: Error
[2020-01-12 09:27:41.430] Running a serial workload
[2020-01-12 09:27:41.430] Request: status
[2020-01-12 09:27:41.434] Status: Error
[2020-01-12 09:30:37.190] recheck 1 modified, 0 deleted files
[2020-01-12 09:30:37.190] modified files:
[2020-01-12 09:30:37.190] 1/1: C:\git\Project\src\fileChanged.js
[2020-01-12 09:30:37.190] Parsing
[2020-01-12 09:30:37.532] Resolved requires are unchanged
[2020-01-12 09:30:38.084] Canceling since a recheck is needed
[2020-01-12 09:30:38.095] Canceling progress 1/12
[2020-01-12 09:30:38.099] Canceling progress 2/12
[2020-01-12 09:30:38.101] Canceling progress 3/12
[2020-01-12 09:30:38.109] Canceling progress 4/12
[2020-01-12 09:30:38.110] Canceling progress 5/12
[2020-01-12 09:30:38.111] Canceling progress 6/12
[2020-01-12 09:30:38.111] Canceling progress 7/12
[2020-01-12 09:30:38.118] Canceling progress 8/12
[2020-01-12 09:30:38.118] Canceling progress 9/12
[2020-01-12 09:30:38.120] Canceling progress 10/12
[2020-01-12 09:30:38.122] Canceling progress 11/12
[2020-01-12 09:30:38.123] Canceling progress 12/12
[2020-01-12 09:30:38.123] Recheck successfully canceled. Restarting the recheck to include new file changes
[2020-01-12 09:30:38.123] recheck 1 modified, 0 deleted files
[2020-01-12 09:30:38.123] modified files:
[2020-01-12 09:30:38.123] 1/1: C:\git\Project\src\fileChanged.js
[2020-01-12 09:30:38.123] Parsing
[2020-01-12 09:30:38.381] Resolved requires are unchanged
[2020-01-12 09:30:38.381] Recheck successfully canceled. Restarting the recheck to include new file changes
[2020-01-12 09:30:38.381] recheck 1 modified, 0 deleted files
[2020-01-12 09:30:38.381] modified files:
[2020-01-12 09:30:38.381] 1/1: C:\git\Project\src\fileChanged.js
[2020-01-12 09:30:38.381] Parsing
[2020-01-12 09:30:38.643] Resolved requires are unchanged
[2020-01-12 09:30:38.643] Recheck successfully canceled. Restarting the recheck to include new file changes
[2020-01-12 09:30:38.643] recheck 1 modified, 0 deleted files
[2020-01-12 09:30:38.643] modified files:
[2020-01-12 09:30:38.643] 1/1: C:\git\Project\src\fileChanged.js
[2020-01-12 09:30:38.643] Parsing
[2020-01-12 09:30:38.884] Resolved requires are unchanged
[2020-01-12 09:30:38.884] Recheck successfully canceled. Restarting the recheck to include new file changes
[2020-01-12 09:30:38.884] recheck 1 modified, 0 deleted files
[2020-01-12 09:30:38.884] modified files:
[2020-01-12 09:30:38.884] 1/1: C:\git\Project\src\fileChanged.js
[2020-01-12 09:30:38.884] Parsing
[2020-01-12 09:30:39.119] Resolved requires are unchanged
[2020-01-12 09:30:39.119] Recheck successfully canceled. Restarting the recheck to include new file changes
[2020-01-12 09:30:39.119] recheck 1 modified, 0 deleted files
[2020-01-12 09:30:39.119] modified files:
[2020-01-12 09:30:39.119] 1/1: C:\git\Project\src\fileChanged.js
[2020-01-12 09:30:39.119] Parsing
[2020-01-12 09:30:39.354] Resolved requires are unchanged
[2020-01-12 09:30:39.354] Recheck successfully canceled. Restarting the recheck to include new file changes
[2020-01-12 09:30:39.354] recheck 1 modified, 0 deleted files
[2020-01-12 09:30:39.354] modified files:
[2020-01-12 09:30:39.354] 1/1: C:\git\Project\src\fileChanged.js
[2020-01-12 09:30:39.354] Parsing
[2020-01-12 09:30:39.595] Resolved requires are unchanged
[2020-01-12 09:30:39.595] Recheck successfully canceled. Restarting the recheck to include new file changes
[2020-01-12 09:30:39.595] recheck 1 modified, 0 deleted files
[2020-01-12 09:30:39.595] modified files:
[2020-01-12 09:30:39.595] 1/1: C:\git\Project\src\fileChanged.js

(this continues in a loop forever)

monitor logs:

Jan 12 09:27:39.429 [info] File watcher reported 1 file changed
Jan 12 09:30:37.178 [info] File watcher reported 2 files changed
Jan 12 09:30:37.369 [error] Closing connection 'some ephemeral connection' due to uncaught exception in read loop: Unix.Unix_error(Unix.ECONNRESET, "write", "")
Jan 12 09:30:37.369 [error] backtrace:
Jan 12 09:30:37.369 [error] Raised by primitive operation at file "src/unix/lwt_unix.cppo.ml", line 626, characters 38-65
Jan 12 09:30:37.369 [error] Called from file "src/unix/lwt_unix.cppo.ml", line 545, characters 17-28
Jan 12 09:30:37.369 [error] Re-raised at file "src/monitor/connections/flowServerMonitorConnection.ml", line 160, characters 6-232
Jan 12 09:30:37.369 [error] Re-raised at file "src/hack_forked/utils/core/exception.ml", line 36, characters 33-76
Jan 12 09:30:37.369 [error] Called from file "src/hack_forked/utils/core/exception.ml", line 40, characters 20-29
Jan 12 09:30:37.369 [error] 
Jan 12 09:30:38.009 [info] File watcher reported 1 file changed

(this does not continue any further)

bug

All 6 comments

Thanks, we've recently had some reports of this internally and I'm looking into it. Could you confirm that you're on v0.105.0? So far I've only seen reports from v0.115.0 or later, so this could help me pin down when the issue appeared.

@nmote I mistyped - I am on 0.115.0 - corrected above. I didn鈥檛 see it before this version. Let me know if I can provide any more info or help. Thanks.

I tried re-saving the files, hoping that might break out of the loop but that doesn鈥檛 help - once it鈥檚 in the loop I can鈥檛 get it to come out.

Thanks for the info, I will update this thread with what I find

I'm going to release v0.116.1 with this fix

v0.116.1 is out

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mmollaverdi picture mmollaverdi  路  3Comments

john-gold picture john-gold  路  3Comments

funtaps picture funtaps  路  3Comments

jamiebuilds picture jamiebuilds  路  3Comments

ctrlplusb picture ctrlplusb  路  3Comments