-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Added loop guard to loops that have a dynamic exit condition. #66
Conversation
Just one question on this one @erikh2000 - can you run the benchmark test and post the results with and without the loop guard just so we can be sure it's not too detrimental. Thanks |
Sure. I ran bench a few times with this PR in and a few times with this PR out. Overall time seems to change by +/- 2 seconds for me from run to run even with no changes to code. Overall time (with loop guard):
Overall time (no loop guard):
An example run with this PR (loop guard) in:
|
@rowanwins can we get this fix for the infinite loop merged? We're running into some infinite loop scenarios too. |
@w8r I am also running into infinite loops but no way to debug them, because javascript. Cannot even debug the infinite loops or other errors until this PR (or similar one) is merged, because I am just hanging, no way to know when to log as it is too late to do so once the infinite loop starts... No way to cancel, timeout, force quit, nothing. Probably I will just look for a different library at this point, infinite loops are a dealbreaker. |
I think it makes sense to add the loop guard even though it may hide
errors. The inf. loop will crash browser pages which is quite severe.
But that's not my decision.
You might also file a bug with the specific call params that generate the
infinite loop.
…On Thu, Aug 5, 2021, 12:02 PM Hans Brende ***@***.***> wrote:
@w8r <https://github.com/w8r> I am also running into infinite loops but
no way to debug them, because javascript. Cannot even debug the infinite
loops or other errors until this PR (or similar one) is merged, because I
am just hanging, no way to know when to log as it is too late to do so once
the infinite loop starts... probably I will just look for a different
library at this point, infinite loops are a dealbreaker.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#66 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACB3GHQMJW5WUTC6YBE6LUDT3LN4HANCNFSM4EQLKV5A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Please see #63 for the rationale behind this.
There were just two loops in the code that have a dynamic exit condition. I didn't see any reason to guard the other loops, because they have a constant exit condition, so their behavior is easily predictable. Of the two places where a guard is added in this PR, only the inner loop of
connectEdges()
has generated infinite loops that I'm aware of. There could be some fundamental change made to the loop code where we are 100% sure it will never inf-loop, but this guard will keep browsers from crashing until that time. Have tested this successfully on the known cases that I reported.