-
Notifications
You must be signed in to change notification settings - Fork 927
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
Make it clearer that HttpResponse construction should generally not block #2064
Comments
I'm looking into openzipkin-contrib/zipkin-storage-kafka@c5d6976 but I don't see why the previous version does not work. Could you elaborate? Internally, an |
For an annotated service when returning an HttpResponse the logic is run on the event loop but when returning an aggregated one it's run on the blocking executor. This seems to make sense to me since one is streamable, but easy to accidentally use HttpResponse, make blocking calls, and deadlock. |
Oh, I never knew returning an |
I guess we need an annotation then to control the executor :) |
Yeah. Something like |
Yeah seems good. But I think most code right now returns json and such, which also run on blocking (HttpResponse and CompletionStage run on event loop). Is it too huge of a behavior change? |
I guess it's fine as long as we make it clear in our release note? 😅 |
I guess so :) But we might consider adding a version that logs warnings that users need to add the annotation before changing - if it were just a class load exception or something it's still easy to debug if you missed the release notes, but if it's deadlocks people could get very confused. |
Created: #2078 |
Thanks! I'll close this one then. |
This is just food for thought, can close if we're happy already.
I find it's too easy for users to shoot themselves in the foot since the difference in "semantic meaning" of an
HttpResponse
(something that streams) andAggregatedHttpResposne
(something that's collected) is very subtle.openzipkin-contrib/zipkin-storage-kafka@c5d6976
Just changing all references of
HttpResponse
toAggregatedHttpResponse
compiles, but changes the behavior completely from not-work to work. This is very subtle.Should we reconsider providing the helpers that return a
HttpResponse
based on collected payloads? Removefrom(CompletableStage<HttpResponse>)
in favor offrom(CompletableStage<AggregatedHttpResponse>
? Change the naming? Or maybe just do nothing :)The text was updated successfully, but these errors were encountered: