When createIndexes is called, it immediately does a loop over keys.length. If instead of passing in an array for keys, we pass an object with a field called length that has a large value, the shell will stall in the loop. This causes some issues in the jstestfuzzer.
I think the easiest solution would be to just check whether keys is actually an array at the beginning of the function, and if not, to return or throw an error without entering the loop.
This problem is similar to the bug reported here a few years back:
SERVER-19474
- related to
-
SERVER-19474 Calling createIndex() can cause the shell to stall
- Closed
-
SERVER-19672 Array functions in shell can cause stall
- Closed