You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Stellar1999 (via GitHub)" <gi...@apache.org> on 2025/06/17 14:01:00 UTC

[PR] Fix StreamObserver object calls onCompleted() without first calling onNext() will fail. [dubbo]

Stellar1999 opened a new pull request, #15466:
URL: https://github.com/apache/dubbo/pull/15466

   ## What is the purpose of the change?
   
   #15465 
   
   ## Checklist
   - [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
   - [x] Make sure gitHub actions can pass. [Why the workflow is failing and how to fix it?](../CONTRIBUTING.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix StreamObserver object calls onCompleted() without first calling onNext() will fail. [dubbo]

Posted by "Stellar1999 (via GitHub)" <gi...@apache.org>.
Stellar1999 commented on PR #15466:
URL: https://github.com/apache/dubbo/pull/15466#issuecomment-2980809108

   PTAL @oxsean 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix StreamObserver object calls onCompleted() without first calling onNext() will fail. [dubbo]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #15466:
URL: https://github.com/apache/dubbo/pull/15466#issuecomment-2980610395

   ## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/15466?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `0%` with `5 lines` in your changes missing coverage. Please review.
   > Project coverage is 31.49%. Comparing base [(`f7553a0`)](https://app.codecov.io/gh/apache/dubbo/commit/f7553a02cd26229d22d43a67485da36dd4889ac6?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`5e88d90`)](https://app.codecov.io/gh/apache/dubbo/commit/5e88d90729422297623b3a39d6d765aea084601f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/dubbo/pull/15466?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...l/tri/h12/http1/Http1SseServerChannelObserver.java](https://app.codecov.io/gh/apache/dubbo/pull/15466?src=pr&el=tree&filepath=dubbo-rpc%2Fdubbo-rpc-triple%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Frpc%2Fprotocol%2Ftri%2Fh12%2Fhttp1%2FHttp1SseServerChannelObserver.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy10cmlwbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC90cmkvaDEyL2h0dHAxL0h0dHAxU3NlU2VydmVyQ2hhbm5lbE9ic2VydmVyLmphdmE=) | 0.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/15466?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ting/http12/AbstractServerHttpChannelObserver.java](https://app.codecov.io/gh/apache/dubbo/pull/15466?src=pr&el=tree&filepath=dubbo-remoting%2Fdubbo-remoting-http12%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Fremoting%2Fhttp12%2FAbstractServerHttpChannelObserver.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctaHR0cDEyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9odHRwMTIvQWJzdHJhY3RTZXJ2ZXJIdHRwQ2hhbm5lbE9ic2VydmVyLmphdmE=) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/15466?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   > :exclamation:  There is a different number of reports uploaded between BASE (f7553a0) and HEAD (5e88d90). Click for more details.
   > 
   > <details><summary>HEAD has 3 uploads less than BASE</summary>
   >
   >| Flag | BASE (f7553a0) | HEAD (5e88d90) |
   >|------|------|------|
   >|integration-tests-java17|1|0|
   >|integration-tests-java8|1|0|
   >|unit-tests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@              Coverage Diff              @@
   ##                3.3   #15466       +/-   ##
   =============================================
   - Coverage     60.94%   31.49%   -29.45%     
   + Complexity    11451     9641     -1810     
   =============================================
     Files          1888     1888               
     Lines         86363    86368        +5     
     Branches      12956    12956               
   =============================================
   - Hits          52633    27205    -25428     
   - Misses        28298    55065    +26767     
   + Partials       5432     4098     -1334     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/dubbo/pull/15466/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [integration-tests-java17](https://app.codecov.io/gh/apache/dubbo/pull/15466/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/15466/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [samples-tests-java17](https://app.codecov.io/gh/apache/dubbo/pull/15466/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `31.45% <0.00%> (-0.01%)` | :arrow_down: |
   | [samples-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/15466/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `29.25% <0.00%> (-0.11%)` | :arrow_down: |
   | [unit-tests](https://app.codecov.io/gh/apache/dubbo/pull/15466/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dubbo/pull/15466?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix StreamObserver object calls onCompleted() without first calling onNext() will fail. [dubbo]

Posted by "Stellar1999 (via GitHub)" <gi...@apache.org>.
Stellar1999 commented on code in PR #15466:
URL: https://github.com/apache/dubbo/pull/15466#discussion_r2153851862


##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/h12/http1/Http1SseServerChannelObserver.java:
##########
@@ -35,6 +35,12 @@ public void setResponseEncoder(HttpMessageEncoder responseEncoder) {
         super.setResponseEncoder(new ServerSentEventEncoder(responseEncoder));
     }
 
+    @Override
+    protected void doOnCompleted(Throwable throwable) {
+        sendMetadata(encodeHttpMetadata(true));

Review Comment:
   You're right.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix StreamObserver object calls onCompleted() without first calling onNext() will fail. [dubbo]

Posted by "Stellar1999 (via GitHub)" <gi...@apache.org>.
Stellar1999 commented on PR #15466:
URL: https://github.com/apache/dubbo/pull/15466#issuecomment-2983011451

   > Http2SseServerChannelObserver should be update too.
   
   A little diff.PTAL @oxsean 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix StreamObserver object calls onCompleted() without first calling onNext() will fail. [dubbo]

Posted by "zrlw (via GitHub)" <gi...@apache.org>.
zrlw merged PR #15466:
URL: https://github.com/apache/dubbo/pull/15466


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix StreamObserver object calls onCompleted() without first calling onNext() will fail. [dubbo]

Posted by "oxsean (via GitHub)" <gi...@apache.org>.
oxsean commented on code in PR #15466:
URL: https://github.com/apache/dubbo/pull/15466#discussion_r2153533157


##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/h12/http1/Http1SseServerChannelObserver.java:
##########
@@ -35,6 +35,12 @@ public void setResponseEncoder(HttpMessageEncoder responseEncoder) {
         super.setResponseEncoder(new ServerSentEventEncoder(responseEncoder));
     }
 
+    @Override
+    protected void doOnCompleted(Throwable throwable) {
+        sendMetadata(encodeHttpMetadata(true));

Review Comment:
   Your previous approach was correct — a check is needed here to avoid an unnesssory encoding of Metadata



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org