-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jsonnet-lint hangs under certain conditions #541
Comments
This is the output of running the bash loop on my machine
|
Thank you very much for reporting and for the isolated repro intructions. I was able to reproduce it getting really slow at higher counts, with roughly 2x increase each time. This is weird and is probably fixable. For the most part the times are stable (withing ~10% of the median), but I confirm the rare cases of it finishing almost immediately (<0.01s). This appears to happen more rarely at higher counts. I don't see any obvious reason for this behavior. The only nondeterminism I can think of is the order of map elements. I will update here once I know more. |
Found the issue. There is some accidental aliasing going on (a classic problem in Go...). This results in an object representation being added to itself multiple times (without removing duplicate information). Normally only already-normalized representations are added like that, so there is no explosion of this kind. This is also a correctness issue (it may result in fewer warnings). I have a prototype fix ready, but I need to clean it up (and solve the same issue for arrays and functions). |
We had some accidental aliasing due to shallow copy instead of deep copy. Fixes google#541.
OK, I'm down to one file that jsonnet-lint refuses to process. It basically hangs and ultimately gets killed by what I'm assuming is an OOM killer on my Mac. The weird thing is that sometimes it will return just fine in sub-second.
That file has all sorts of proprietary stuff in it so I've tried my best to create a repro test case but you'll have to tell me if it worked :)
bash-loop.sh
- it should show you processing times increase as the number of keys in thecaller.jsonnet
map increases and will eventually reach a point where jsonnet-lint doesn't return.I've no idea what's going but it feels like some sort of quadratic/ exponential processing, or some lock contention. As I mentioned, the weird part is that every so often it will return just fine.
The text was updated successfully, but these errors were encountered: