-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Remote registry client does not map application errors #4392
Comments
@dmartinol (This might be more relevant for online store/offline store, but...) Do you think the goal here should be to forward all exceptions or only ones defined by feast? If we forward all, I think we should aim to "re-raise" feast exceptions, but suppress all others behind some new exception type. |
@tokoko Yes, the problem is broader than described in the issue. Ideally, we should remap all exceptions across all servers to ensure the client code remains agnostic of the underlying implementation. Not an easy task, also considering the number of exception that have been modelled, but worth to invest some time. |
@tokoko what about to tackle this one, maybe stating from the registry server? |
@dmartinol I haven't looked into it too much, but I agree, "serialize and deserialize" is definitely the wrong way to go about it. I'm thinking, we should use richer grpc error messages (don't know what that means, but sounds suitable) to transfer two string values (exception type and exception message). I think we should start by limiting transferred exceptions exclusively to feast exception types and reassess later if there are any other core exceptions that also need to be treated in a similar fashion. One reason for not trying to pass any more details (trace + other exceptions) is that at least in case of a feature server I think we should assume that a possible future server implementation might not be python-based, so binding error information to python too much can be a headache. |
Agree on the error model, that has to be minimalistic and compatible with all the communication protocols used by the Feast servers. Are you already working on this issue or do you want any of us to contribute? |
No, not working on it. Feel free to take it up, let me unassign myself. |
Looked at the grpc options, and I think we have an int value with a predefined status code that we cannot customize, and a detail label. ...
except Exception as e:
m = {
"type": f"{type(e).__name__}",
"message": f"{str(e)}"
}
context.abort(
grpc.StatusCode.INTERNAL,
json.dumps(m),
)
... To optimize it, we can limit the |
started draft PR #4458 to verify we are in sync. |
@dmartinol yeah, json sounds good to me, certainly better than a single concatenated string. btw, we should probably create a |
I was thinking the same, and can also have a |
yeah, I think so. We should switch to |
Some numbers: 8 Feast classes named like |
Agreed |
@tokoko Can we keep this open to apply the same error mapping to the remaining servers, or do you prefer dedicated GH issues instead? |
dedicated issues would be better imho, they are almost completely different problems to solve from implementation perspective. |
@tmihalac @lokeshrangineni could you pls raise server-specific issues to track the error mapping problem? |
Expected Behavior
A feast application has a registry of type remote connected to a registry server.
The feast client invokes a an API on the feast registry that thrown an error, e.g.
store.get_feature_service("foo")
which raisesFeatureServiceNotFoundException
from the registry server becausefoo
is not a registered feature service.The expectation is that the method invoked by the client raises the
FeatureServiceNotFoundException
and the application can detect it with:Current Behavior
The registy server always raises an
_InactiveRpcError
error instead.This bug causes unexpected errors when the client invokes services whose implementation needs such expections to execute fall-back logic, like _get_feature_views_to_materialize.
Steps to reproduce
See
Expected Behavior
section.Specifications
Possible Solution
The registry server can wrap the original exception in an error status message that the remote registry client can catch and translate into the original exception:
The text was updated successfully, but these errors were encountered: