-
Notifications
You must be signed in to change notification settings - Fork 271
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
lib/src/server/handlers.dart 's _customHeaders is reset to null, it should be reset to empty Map instead #736
Comments
I think the current code is correct. You can only send headers once so they are intentionally reset to I also see that the benchmark code in question is referencing Dart 2.19 and We will need to know exact stack trace and exact version of grpc package for this to be actionable. For now I am going to close this - but if r/David_Owens provides necessary info I can reopen. |
Here is a screen shot of the stack trace. It's running in a Docker container and only comes up for a split second, so I had to take a video of it. https://1drv.ms/i/c/29ea63e9e7ad0202/EQ3bEw8Cer1KrEQHk-vpYmABnqFhUoNf85uwvdy7C0MLqQ?e=oGMD3A 0 ServerHandler.sendTrailers (package:grpc/src/server/handler.dart:384) |
@owensdj what is the version of the package / Dart SDK you are using? |
gRPC 4.0.1 and Dart SDK 3.5.2. The problem happened with older versions as well. |
One possible issue is that here https://github.com/grpc/grpc-dart/blob/master/lib/src/server/handler.dart#L360-L367 |
@mraleph That makes sense, but if you look at the call stack I don't see where the execution would have set _customHeaders to null. The only places where it's ever set to null is in sendHeaders on line 361 and in sendTrailers on line 388. I don't see sendHeaders in the call stack and it crashes at line 384 in sendTrailers before it gets to the line setting _customHeaders to null. |
That is correct that we don't see If I put
So I think this is the most possible explanation. |
Error report:
https://www.reddit.com/r/dartlang/comments/1fk84bb/unhandled_exception_from_grpc_package/
The reported line seems to be when forcing
_customHeaders
to not-null: https://github.com/grpc/grpc-dart/blob/master/lib/src/server/handler.dart#L384Looking at the git blame history, I think
_customHeaders = null
should have been migrated to_customHeaders = <String, String>{}
when the null-safety migration happened.The text was updated successfully, but these errors were encountered: