-
Notifications
You must be signed in to change notification settings - Fork 537
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
Design/change how container is returned during loader.resolve() #4519
Comments
Today, we return container only after we are done loading snapshot. That's too late for these scenarios: - we hit 429 and keep retrying. There is nowhere to report progress or cancel as host does not have container yet - People register for "connected" and "disconnected" events but never check initial state (Container.connected), assuming that is is always disconnected. Similar problem exists in other places (and more places will be in same bucket, like dirty flag). Ideally initial state of container is always pre-defined, but we also notify users of it by calling appropriate handler on registration. - We have no good point in time to console.error if someone did not register for "close" - doing it when we raised an error is a bit too late (this is next follow up) This solution allows us to return shell container object (not hitting anything that can fail) much earlier, to give a chance for host to put all handlers, and then continue loading.
So some history: That all said, it's really not good practice to have network (or any other blocking) calls without ability to cancel and track progress. Note that this helps a lot (and resolves this issue), but we also should holistically look into overall problem that is tracked by issue #5192 (Add cancelation tokens to read/write blob APIs) |
Closing old issues. |
Describe the bug
After the infinite blob/tree fetch retry for storage we need to change how we return the container to the app because app needs to know what is happening with the container when it is busy retrying fetching during load.
Today, policy of Container only retry after we've done loading (i.e. Container.load() returned and Container.loaded === true).
We do not retry and fail immediately while within Container.load. This is sort of required today as user experience would be not great if we loop forever waiting for bits and pieces while client is offline - hosting app has no object to check status / cancel operations, as we return Container form loader.resolve() only after Container.load() is done. We either need to maintain this invariant, or change when / how Container is returned to client. I think later is better, but we need to design it separately.
#4427
The text was updated successfully, but these errors were encountered: