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

异步消费总是提示 request timeout #701

Closed
Imfan opened this issue Jul 18, 2021 · 0 comments · Fixed by #702
Closed

异步消费总是提示 request timeout #701

Imfan opened this issue Jul 18, 2021 · 0 comments · Fixed by #702
Labels
bug Something isn't working

Comments

@Imfan
Copy link
Contributor

Imfan commented Jul 18, 2021

用demo里的异步消费总是提示 request timeout

感觉是 producer 247行

	var cancel context.CancelFunc
	ctx, cancel = context.WithTimeout(ctx, 3*time.Second)
	defer cancel()

这里调用了cancel(),但是 在 go primitive.WithRecover 这里起了个协程等待响应。
cancel()大概率会 先执行,然后执行了这里的代码

去了cancel(),应该也不会有内存泄露,因为select的另一个分支会执行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants