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
Removes store._adapterRun #4703
Removes store._adapterRun #4703
Conversation
I believe this is ready to merge, but per @igorT's request I'm going to get this running against our app's test suite to see if there are any unknown consequences. |
store._adapterRun(() => { | ||
/* | ||
Note to future spelunkers hoping to optimize. | ||
We rely on this `run` creating a nested run loop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear this may not be what backburner itself considers a nested run-loop, as it has its own concept of this. Internal BB handles nested run-loops via a stack of run-loops
For example:
Ember.run(() => Ember.run(() => /* nested run loop */));
Both have the same queues, and an inner one may capture things actually intended for the outer one (today). Which will have nested renders etc.
Ember.run(() => store._backburner.run(() => /* nested but entirely independently run-loop */));
Two run loops, but different queues so Ember.run.schedules within the bb.run will escape to the outer one, but bb.schedules wil remain captured.
TL;DR words are hard, maybe we should re-jigger the words in this comment.
@stefanpenner this is actually a nested run loop for EDs internal backburner. |
The outer loop is opened by _push. |
@runspired I don't believe so, the comment is within a |
@stefanpenner I'll reason through this a little bit later but there's definitely something ED bb related going on here. |
I can believe that, but it may require some additional investigation. Let me know if you find something else. Or if i can provide clarity to my above claims. |
c0db2cb
to
98caea2
Compare
@stefanpenner so after doing a little logging and reasoning through, that run is needed for two reasons but could have been (and now is) a TL;DR
|
I don't believe this is possible, example? The only way I can think of getting into this, should be a high priority fix itself: ed._run(function() {
Ember.run(function() {
RSVP.Promise.resolve().then(function() {
ed._run.join(function() {
});
});
}); The other way, (a variation of the above) is if the |
This is actually precisely what is happening, however I don't believe we have a path off of this at the moment. |
@runspired whats the easiest way for me to replicate. I would like to see if we can confirm, and get off. |
@stefanpenner set a flag inside of |
I wonder if |
This may also be affected by everything chaining off of |
@runspired are you in the office tomorrow? We should just pair. |
…he number of run loops and closures created.
98caea2
to
3475857
Compare
With #4698 having landed, it's potentially possible we can remove some if not all calls to
store._adapterRun
. This PR currently removes all calls, leading to a small handful of failed tests which I'm investigating. I'll also run it against LI's test suite once those pass (if I can make them pass) to see if there are undocumented behaviors that this might break.Benefits
finders
cc @igor for recommending I investigate this.