-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[vm_service] VmServerConnection does not handle SentinelExceptions as prescribed by the vm service interface #51752
Comments
/cc @bkonyi @derekxu16 |
Here's my analysis of the problem:
sdk/pkg/vm_service/lib/src/vm_service.dart Lines 2444 to 2445 in 4faf18d
I'm don't have a clear understanding of how sdk/pkg/vm_service/lib/src/vm_service.dart Line 1795 in 4faf18d
and store sdk/pkg/vm_service/lib/src/vm_service.dart Lines 2444 to 2445 in 4faf18d
But maybe |
A The issue here is that when the client is invoking {
"jsonrpc": "2.0",
"id": 123,
"data": {
"type": "Sentinel"
"kind": "Collected",
"valueAsString": "Sentinel <collected>"
}
} |
@bkonyi I think I tried that in my experiments while fixing the flutter test flake, but a if i remember correctly it does not result in throwing exception from the |
Looks like returning a sentinel value as @bkonyi suggested does fix the problem, because sdk/pkg/vm_service/lib/src/vm_service.dart Line 2450 in 4faf18d
|
|
Fixed in |
VmServerConnection
seems to convertSentinelException
to an RPC error. This has caused flakes in flutter web tests:Parent issue: flutter/flutter#121708
The issue above currently has a PR that resolves it for one case, but we should have a reliable solution that works for all vm service API and their clients, to prevent more hard-to-detect failures due to inconsistencies in checks.
Details
dwds' chrome proxy service throws a sentinel exception on
getIsolate
for non-existing isolate id, as required by theVmServiceInterface
:sdk/pkg/vm_service/lib/src/vm_service.dart
Line 690 in 67f3e1f
but the
VmServerConnection
translates it into an RPC error withRPCError.kInternalError
as code, and the sentinel is added to the message as a string:sdk/pkg/vm_service/lib/src/vm_service.dart
Line 1795 in 67f3e1f
The clients then need to check for the string contents to contain a sentinel kind. See flutter/flutter#122776 (comment) for a client check example.
Should we change the
VmServerConnection
to throw something different, or have a set of error codes inpackage:vm_service
we all agree on in servers and clients can check for in their code?The text was updated successfully, but these errors were encountered: