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

[Bug] Send trace data fail because context.cancel() early #774

Closed
lifepuzzlefun opened this issue Jan 26, 2022 · 1 comment · Fixed by #856
Closed

[Bug] Send trace data fail because context.cancel() early #774

lifepuzzlefun opened this issue Jan 26, 2022 · 1 comment · Fixed by #856
Labels

Comments

@lifepuzzlefun
Copy link
Contributor

BUG REPORT

  1. Please describe the issue you observed:

master code.
local cluster.
example/producer/trace/main.go

  1. Please tell us about your environment:

  2. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):

see master code

var req = td.buildSendRequest(mq, msg)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
err := td.cli.InvokeAsync(ctx, addr, req, func(command *remote.RemotingCommand, e error) {
resp := primitive.NewSendResult()
if e != nil {
rlog.Info("send trace data error.", map[string]interface{}{
"traceData": data,
})
} else {
td.cli.ProcessSendResponse(mq.BrokerName, command, resp, msg)
rlog.Debug("send trace data success:", map[string]interface{}{
"SendResult": resp,
"traceData": data,
})
}
})
if err != nil {
rlog.Info("send trace data error when invoke", map[string]interface{}{
rlog.LogKeyUnderlayError: err,
})
}
}

@lifepuzzlefun lifepuzzlefun changed the title Send trace data fail because context.cancel() early [Bug]Send trace data fail because context.cancel() early Jan 26, 2022
@lifepuzzlefun lifepuzzlefun changed the title [Bug]Send trace data fail because context.cancel() early [Bug] Send trace data fail because context.cancel() early Jan 26, 2022
@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
@stale stale bot closed this as completed Apr 30, 2022
duhenglucky added a commit that referenced this issue Jul 20, 2022
[ISSUE #774] Avoid cancel context too early cause trace data fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant