-
Notifications
You must be signed in to change notification settings - Fork 536
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
Handle Routing Incorrectly Returning DataStore rather than Error #4613
Comments
I can take a look at this. Will have to run the test to see what's happening. Why is handle routing supposed to fail here? |
I found this looking for another issue. That issue is that when the snapshot header request fails for the sequence we are not propagating that, which just lead to an empty sequence. Now I throw from load in the sequence to fail loading. I don't know quite what the right behavior is here, my hunch is that that handle get should also throw, but not sure how that is plumbed. For the above test, i create a mock for the storage service, and throw when it detects a read on the sequence's header blob (same problem as described above). So when we load the shared string via handle i would expect that failure to bubble up some how |
i traced the code a bit, and the load does fail, but then the request handled mixin @vladsud added kicks in, and ends up returning the data store itself |
I did not read it very carefully, but mixinRequestHandler() is only used when we have external handler, and it just calls it if main request failed with 404. If it converts failure to non-failure, that means the request handler that mixinRequestHandler got does it, i.e. it's in user code. |
i didn't look super closely, as trying to figure out the other issue right now. the test repro's it 100%. the last sharedString var will actually be a ITestFluidObject after the handle is retrieved. |
Let me try to repro this and debug. |
I found the issue -
Looks like that's the bug. I am not sure why TestFluidObject is using mixin when it doesn't really want to handle requests. We should remove it or handle it appropriately. |
Yes, we have a lot of (mostly sample code, but I saw and fixed similar patterns in shipping code) where objects would not even look at request and return itself. That's pretty much always wrong - objects like that should test for query to be empty. |
I don't really understand how this is even ending up on the request function of the test object, that seems wrong to me, and will likely be unexpected by data store authors. |
I think something like this needs to be done: i think 404 is the wrong error, and is handled at other layers, which is what kicks us down the data object request path. then i think we should throw from the get with the channel resolution failure |
I'd say that's good change, but it's not enough. Objects should not handle all requests that are coming their way. They should be explicitly handling "/" only in case of terminating node in request tree. |
I agree that object shouldn't handle all request, but we also should only route a request to objects that should reasonably expect them. Happy to commit that change if we think it's good enough. |
We also need to fix the request handler in TestFluidObject and other examples. Created #4621 to track this. |
i'm almost thinking that dataStoreRuntime should mirror container runtime and have a resolveHandle method rather than going down the request flow here |
Return 500 on channel load failure, rather than 404 which is handled differently throughout the stack related #4613
Trying to resolve a handle to a dds from a key on a map which is expected to fail, but instead returns the handle to the data store. Below is the test
The text was updated successfully, but these errors were encountered: