-
Notifications
You must be signed in to change notification settings - Fork 104
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
Prevent taskq cash due to msg.Ctx nil and ack message before delete it #153
Prevent taskq cash due to msg.Ctx nil and ack message before delete it #153
Conversation
d31b378
to
858a0e4
Compare
redisq/queue.go
Outdated
stack := string(debug.Stack()) | ||
internal.Logger.Printf("%v,panic recovered: %v,stack=%s", name, err, stack) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not do this. It hides the problem, not fixes it.
Panics are exceptional situations that can leave you app in a broken state. It may be better to let the app crash and restart it then to recover.
// When Release a msg, ack it before we delete msg. | ||
if err := pipe.XAck(msg.Ctx, q.stream, q.streamGroup, msg.ID).Err(); err != nil { | ||
return err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
97120fe
to
c1e5c06
Compare
prevent it from crash in some cases
c1e5c06
to
819b42b
Compare
Thanks |
Used the same solution as vmihailenco#153
Used the same solution as vmihailenco#153
close #150