-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Potențial infinite recursion on updateModalState #923
Comments
Just kidding. This didn't actually fix anything. I'll keep digging |
Maybe I understand a bit more of what's happening. Potentially an execution queue contention? I can easily replicate the issue by changing a node attribute (just by updating the name, for example), clicking save, and immediately jumping back to the Devices page. This might be coinciding with a scan execution. looking a bit more I see the actual calls are coming from 'app/front/devices.php',
and when I watch the execution log, I'll see the 'update_api|devices' line in the file. Once I see that line drop from the log, the page loads. There doesn't seem to be anything useful in the debug logs but I saved some examples if it'll help. |
Hey @seanmdalton , Thanks a lot spending this much time digging into this. I'm not 100% sure whats going on, but I'll explain how this is supposed to work. Happy to improve if you have ideas or even accept a PR :)
Maybe this is too convoluted, so happy to hear about possible improvements. |
Is there an existing issue for this?
The issue occurs in the following browsers. Select at least 2.
Current Behavior
When only loading the main Devices page, I noticed the Loading modal spinning for an excessive period of time (30+ seconds). When I pulled up the browser console (Google Chrome), I saw 8k (and quickly counting) requests to
/php/server/query_logs.php?file=execution_queue.log&nocache=1735577383548
before my browser crashed.When inspecting these calls, I see the following output:
Upon digging in (and pardon some naivety here), I'm seeing an infinitely recursive function that seems to be the cause: updateModalStat()
I threw a 'return true;' before the setTimeOut function/ajax call, and it stopped entirely. Page loads fine now (but of course lacking whatever this code block is doing).
I don't fully grok the intention of this code chain/block, so I don't want to presume a fix, but I can provide any other data you think would be helpful.
I'm running Netalert in Docker, on a macvlan network, behind Traefik/TLS, and I haven't noticed any other problems. Every other page loads perfectly fine/fast.
Expected Behavior
Since I don't know the intentions of the code block, I'm not sure what the expected behavior to be. That said, I'd expect there to be potentially a pause between calls to limit load on the service, some break condition in the recursive stack, and this to not block (by not removing the modal) the load of the rest of the page.
Steps To Reproduce
app.conf
No response
docker-compose.yml
No response
What branch are you running?
Production
app.log
No response
Debug enabled
The text was updated successfully, but these errors were encountered: