Skip to content

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

@Imfan

Description

@Imfan

用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的另一个分支会执行

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions