Skip to content
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

response future done channel close late causes normal requests to report a timeout error #1114

Open
twz915 opened this issue Nov 28, 2023 · 0 comments

Comments

@twz915
Copy link
Contributor

twz915 commented Nov 28, 2023

The issue tracker is ONLY used for the go client (feature request of RocketMQ need to follow RIP process). Keep in mind, please check whether there is an existing same report before your raise a new one.

Alternately (especially if your communication is not a bug report), you can send mail to our mailing lists. We welcome any friendly suggestions, bug fixes, collaboration, and other improvements.

Please ensure that your bug report is clear and that it is complete. Otherwise, we may be unable to understand it or to reproduce it, either of which would prevent us from fixing the bug. We strongly recommend the report(bug report or feature request) could include some hints as to the following:

BUG REPORT

  1. Please describe the issue you observed:
    When ctx time out, r.ctx.Done() returns, causing a normal response to return an error as well

responseFuture.executeInvokeCallback()
if responseFuture.Done != nil {
close(responseFuture.Done)

select {
case <-r.Done:
cmd, err = r.ResponseCommand, r.Err
case <-r.ctx.Done():
err = errors.ErrRequestTimeout
r.Err = err
}

A simple way to reproduce this is to add time.Sleep(time.Second*3) before if r.callback != nil, then callback return get resp.Err, which is not nil

https://github.com/apache/rocketmq-client-go/blob/7ae83c49351a96d78ebccec5dd545f0c05e3d514/internal/remote/future.go#L47C5-L53

So response future should close channel before callback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant