facebook / flow

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

Worker.Worker_exited_abnormally(16) when processing the code #3143

Closed vojtatranta closed 1 year ago

vojtatranta commented 7 years ago

Version 0.37.4

Hi there, I have troubles to spawn Flow server. For moment it ran but know, it just keep trying to initialize over and over. A while after processing starts this gets to the log:

[2017-01-06 00:23:09] Initializing Server (This might take some time)
[2017-01-06 00:23:09] executable=/Users/vojtatranta/source/avocode/avocode-next/node_modules/flow-bin/flow-osx-v0.37.4/flow
[2017-01-06 00:23:09] version=0.37.4
[2017-01-06 00:23:09] Parsing
[2017-01-06 00:23:42] Building package heap
[2017-01-06 00:23:44] Loading libraries
[2017-01-06 00:23:45] Running local inference
Worker exited (code: 16)
Worker exited (code: 16)
Worker exited (code: 16)
Worker exited (code: 16)
Worker exited (code: 16)
Worker exited (code: 16)
Worker exited (code: 16)
Subprocess(53243): fail 16Worker.Worker_exited_abnormally(16)
Worker exited (code: 16)

And then flow tries to run same server again...

jankuca commented 7 years ago

Having the same issue. Also flow check does not work. Tried both 0.36 and 0.37.

gabelevi commented 7 years ago

So looking at the exit codes, I think exit code 16 means Flow's shared hash table is full. How large is the code base that you're trying to check? Is it something I can try and repro?

In the meantime, can you try adding this to the options section of your .flowconfig?

sharedmemory.hash_table_pow=21

The default is 19, I believe. This change will quadruple the size of your hash table, from 512k elements to 2M elements. I think each element is 16 bytes, so I think this will end up growing the hash table from 8MB to 32MB.

Does this help?

jankuca commented 7 years ago

In the meantime, I ran rm -rf on my node_modules and npm installed everything including flow-bin and it started working after that. If I run into the issue again, I will try this and let you know.

frontsideair commented 6 years ago

I can reproduce this on the latest version, 0.57.3. I can try to generate a minimal repro and open a new issue if needed.

levenleven commented 6 years ago

Increasing hash table size worked in my case (sharedmemory.hash_table_pow=21). Thanks @gabelevi

JofArnold commented 6 years ago

Discovered this very issue just now (macOS, project with about 200,000 LOC). `sharedmemory.hash_table_pow=21). Thanks @gabelevi. You're an absolute saviour!

sapegin commented 6 years ago

The error message looks like this now:

Worker exited (code: 16)
Worker exited (code: 16)
Worker exited (code: 16)
Worker exited (code: 16)
Worker exited (code: 16)
Worker exited (code: 16)
Worker exited (code: 16)
Worker exited (code: 16)
Subprocess(2138): fail 16Subprocess(2141): fail 16Unhandled exception: SharedMem.Hash_table_full
Raised by primitive operation at file "hack/heap/sharedMem.ml", line 484, characters 58-66
Called from file "hack/heap/workerCancel.ml", line 30, characters 6-10
Re-raised at file "src/core/lwt.ml", line 3008, characters 20-29
Called from file "src/unix/lwt_main.ml", line 42, characters 8-18
Called from file "src/commands/checkCommands.ml", line 108, characters 57-132
Called from file "src/flow.ml", line 86, characters 6-34

But the @gabelevi’s suggestions still fixes it.

pascalduez commented 5 years ago

Flow 0.91.0 Arch Linux Not a particularly huge project

$ flow check src/
Worker exited (code: 16)
Worker exited (code: 16)
Worker exited (code: 16)
Worker exited (code: 16)
Unhandled exception: SharedMem.Hash_table_full
Raised by primitive operation at file "hack/heap/sharedMem.ml", line 484, characters 58-66
Called from file "hack/heap/workerCancel.ml", line 30, characters 6-10
Re-raised at file "src/core/lwt.ml", line 3008, characters 20-29
Called from file "src/unix/lwt_main.ml", line 42, characters 8-18
Called from file "src/commands/checkCommands.ml", line 135, characters 27-86
Called from file "src/commands/commandUtils.ml", line 13, characters 4-32
danielo515 commented 4 years ago

increasing the hash table pow did the trick for me, but I'm not sure about the performance implications.