fix: Maximum call stack size exceeded when open a bot#3025
fix: Maximum call stack size exceeded when open a bot#3025cwhitten merged 8 commits intomicrosoft:masterfrom
Conversation
a-b-r-o-w-n
left a comment
There was a problem hiding this comment.
I'm going to look into this a bit further this morning and add some unit tests. This change seems fine to me, but I'd like to understand why.
The issue is the dereference code will hit a circle once the defCache has value for certain key (which only happens the second time, we try to dereference on on exiting cache), this fix is just to clear the cache, so everytime it's a new cache and won't hit cirle. |
Seems like leilei added a few logs in above, it's pretty much the IDialog causing the circle. |
* if def is found in cache, do not attempt to dereference * make a per-instance cache * check for a circular ref when initially resolving
* fix: Maximum call stack size exceeded when open a bot * use clear * extract schema utils and add tests * if def is found in cache, do not attempt to dereference * make a per-instance cache * check for a circular ref when initially resolving * only process the schema once per project Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com> Co-authored-by: Andy Brown <asbrown002@gmail.com>
Description
I have add a debug information with defName, invoked times and recursion depth in the getRef function
this three types
are looping infinitely
The first time we open the bot, the definitionCache is empty. After doing dereference. The cache has stored the definition.
Then open a new bot again, The Microsoft.BeginDialog is stored in cache already. If we use the value and do dereference continue. There will be a infinite loop. The Microsoft.BeginDialog has a type Microsoft.IDialog, and IDialog has a Microsoft.BeginDialog type.
The schema about Microsoft.IDialog
and part of Microsoft.BeginDialog are
Task Item
refs #3023
Screenshots