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

[FIXED] Fail of publish ack on connection close #298

Merged
merged 1 commit into from
Dec 20, 2019

Conversation

kozlovic
Copy link
Member

We can't invoke the ack handler from the connection close code
since there would be a possible deadlock if user code is calling
any connection method.

This is based out of #297 but without the change on how pub acks
are timed-out (still use timers). So this PR has only tests fixes
and the fix for failing pub acks on connection close.

Signed-off-by: Ivan Kozlovic ivan@synadia.com

@kozlovic
Copy link
Member Author

@derekcollison This is all tests fixes from #297 and simply the fix for the pub acks on connection close. We could use this instead of #297 if we think that changes on that other PR are a bit too much (I can keep the branch to revisit later). As I commented on the other PR, the number of outstanding timers should be limited by the number of MaxPubAcksInflight value.

@coveralls
Copy link

coveralls commented Dec 20, 2019

Coverage Status

Coverage decreased (-0.3%) to 93.717% when pulling f23d453 on fix_pub_acks_on_conn_close into 3b79c52 on master.

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

We can't invoke the ack handler from the connection close code
since there would be a possible deadlock if user code is calling
any connection method.

This is based out of #297 but without the change on how pub acks
are timed-out (still use timers). So this PR has only tests fixes
and the fix for failing pub acks on connection close.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
@kozlovic
Copy link
Member Author

@derekcollison Apologies, I have updated (push force) the PR. Only stan.go was changed. I realized that doing the timer.Reset() would work, but then the error would be ErrTimeout, which in this case ought to be ErrConnectionClosed. So we now collect all the pub acks that have a timer set and can be stopped and then invoke their ack handlers in separate go routine.

Also, once you review this version, we should decide which PR we use, this one or #297. We can close the associated issue and say that we don't think the number of timers will be an issue (due to MaxPubAcksInflight and with possible improvement in Go 1.14...

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Let's go with this one and re-evaluate with Go1.14 in terms of the other. WDYT?

@kozlovic
Copy link
Member Author

Agreed!

@kozlovic kozlovic merged commit 718b5a3 into master Dec 20, 2019
@kozlovic kozlovic deleted the fix_pub_acks_on_conn_close branch December 20, 2019 15:32
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

Successfully merging this pull request may close these issues.

3 participants