facebook / flow

Adds static typing to JavaScript to improve developer productivity and code quality.
https://flow.org/
MIT License
22.07k stars 1.85k forks source link

Flow v57.2 hangs while merging dependencies #5103

Closed ZhangYiJiang closed 6 years ago

ZhangYiJiang commented 6 years ago

I'm not sure what is happening, because the logs stop at 'Merging'. I can't reliably reproduce this - it doesn't happen every time I save a file, but it happens quite frequently. It's hard to tell which file triggered this because it's not immediately obvious in the IDE that the Flow service has hung. This is what the logs look like:

[2017-10-14 09:29:28] Checked set: Focused: 382, Dependents: 0, Dependencies: 0
[2017-10-14 09:29:29] recheck 1 modified, 0 deleted files
[2017-10-14 09:29:29] modified files:
[2017-10-14 09:29:29] 1/1: /home/zhang/Documents/nusmods/v3/src/js/views/timetable/Timetable.jsx
[2017-10-14 09:29:29] Parsing
[2017-10-14 09:29:29] Re-resolving directly dependent files
[2017-10-14 09:29:29] Recalculating dependency graph
[2017-10-14 09:29:29] remerge 5 dependent files:
[2017-10-14 09:29:29] 1/5: /home/zhang/Documents/nusmods/v3/src/js/views/Routes.jsx
[2017-10-14 09:29:29] 2/5: /home/zhang/Documents/nusmods/v3/src/js/views/browse/ModulePageContainer.jsx
[2017-10-14 09:29:29] 3/5: /home/zhang/Documents/nusmods/v3/src/js/views/browse/ModulePageContent.jsx
[2017-10-14 09:29:29] 4/5: /home/zhang/Documents/nusmods/v3/src/js/views/components/module-info/LessonTimetable.jsx
[2017-10-14 09:29:29] 5/5: /home/zhang/Documents/nusmods/v3/src/js/views/timetable/TimetableContainer.jsx
[2017-10-14 09:29:29] Merge prep
[2017-10-14 09:29:29] to_merge: Focused: 1, Dependents: 5, Dependencies: 0
[2017-10-14 09:29:29] Calculating dependencies
[2017-10-14 09:29:29] Merging
[2017-10-14 09:29:29] to_merge: Focused: 0, Dependents: 0, Dependencies: 0
[2017-10-14 09:29:29] Calculating dependencies
[2017-10-14 09:29:29] Merging

It's now more than 10 minutes later. The flow process is still running using up one CPU core.

screenshot from 2017-10-14 09-36-48

Restarting it fixes this temporarily, but after a while it'll hang again. This was not a problem with the previous version of Flow we were using, v0.54.0.

OS: Ubuntu 17.04 Linux 4.10.0-35-generic #39-Ubuntu SMP x86_64 IDE: Webstorm 2017.2.4

szagi3891 commented 6 years ago

I have similar problems.

$ flow status && babel src/ -d dist
flow is rechecking [processing] /

The flow process does not want to stop.

TrySound commented 6 years ago

Same for mac os x

athomann commented 6 years ago

Same issue on node v8.7.0

Y-Taras commented 6 years ago

Same issue on Ubuntu 14.04 x64 IDE Webstorm 2017.3 or Atom

athomann commented 6 years ago

0.57.3 should fix this issue. Just waiting on the npm publish.

sonaye commented 6 years ago

So this is why my laptop fan was so noisy the past couple of days and why the editor's linter stopped showing messages. 0.57.3 is still not on Homebrew, waiting for the release to verify.

dikmax commented 6 years ago

Now 0.57.3 doesn't starts error. Log from Webstorm on MacOS.

[2017-10-17 09:35:07] Logs will go to /private/tmp/flow/zSUserszSmaksimdzZikunzSworkspacezSisCommerce-mobilezSmobilezSapp.log
[2017-10-17 09:35:07] Initializing Server (This might take some time)
[2017-10-17 09:35:07] executable=...
[2017-10-17 09:35:07] version=0.57.3
[2017-10-17 09:35:07] Parsing
[2017-10-17 09:35:35] Building package heap
[2017-10-17 09:35:35] Loading libraries
[2017-10-17 09:35:39] Resolving dependencies
[2017-10-17 09:35:41] to_merge: Focused: 773, Dependents: 0, Dependencies: 0
[2017-10-17 09:35:41] Calculating dependencies
[2017-10-17 09:35:41] Merging
[2017-10-17 09:37:00] Done
[2017-10-17 09:37:00] Checked set: Focused: 773, Dependents: 0, Dependencies: 0
[2017-10-17 09:37:00] Server is READY
[2017-10-17 09:37:00] Took 112.701158 seconds to initialize.
[2017-10-17 09:37:00] Status: Error
[2017-10-17 09:37:19] Status: Error
[2017-10-17 09:37:32] Status: Error
[2017-10-17 09:38:25] Status: Error
ZhangYiJiang commented 6 years ago

I believe Flow 57.3 has fixed this - I've upgraded and so far I've not managed to reproduce the problem, so I'm closing this.

@dikmax That log looks fine - Status: Error indicates that Flow has found errors, not that the Flow process itself encountered an error and cannot start.