Figuring out recursion problems can be a very challenging issue. For example, in https://github.com/canjs/can-stache/issues/650, chrome would crash and it was difficult to figure out what is happening.
I approached this by adding a counter to _logFlush. Once there were over 500 tasks, it would stop running any new tasks and call .logStack().
This pretty much immediately showed me the problem.
I propose we add something like:
queues.stopAfterTaskCount( 500 )
This would only be available in development. You would call stopAfterTaskCount before you have any problems and it would likely die in a meaningful place.
Figuring out recursion problems can be a very challenging issue. For example, in https://github.com/canjs/can-stache/issues/650, chrome would crash and it was difficult to figure out what is happening.
I approached this by adding a counter to
_logFlush
. Once there were over 500 tasks, it would stop running any new tasks and call.logStack()
.This pretty much immediately showed me the problem.
I propose we add something like:
This would only be available in development. You would call
stopAfterTaskCount
before you have any problems and it would likely die in a meaningful place.