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

Fix: make sure FIFO order between write and notify channel active #2597

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

okg-cxf
Copy link

@okg-cxf okg-cxf commented Jan 17, 2024

Fix #2598

If write() comes in between the line this.channel = channel and sharedLock.doExclusive(() -> {} in notifyChannelActive(), the FIFO order is violated since the previous entered commands have not been flushed yet.
See the test case writeShouldGuaranteeFIFOOrder()
Make sure that:

  • [Y] You have read the contribution guidelines.
  • [N] You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request. (No since it is a bug fix instead of a feature).
  • [Y] You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • [Y] You submit test cases (unit or integration tests) that back your changes.

@okg-cxf okg-cxf changed the title Fix/make sure fifo order between write and notify channel active Fix/make sure FIFO order between write and notify channel active Jan 17, 2024
@okg-cxf okg-cxf force-pushed the fix/make-sure-fifo-order-between-write-and-notifyChannelActive branch 2 times, most recently from cf44e24 to d23c68f Compare January 18, 2024 06:18
@okg-cxf okg-cxf changed the title Fix/make sure FIFO order between write and notify channel active Fix: make sure FIFO order between write and notify channel active Jan 18, 2024
@okg-cxf okg-cxf changed the title Fix: make sure FIFO order between write and notify channel active Fix: make sure FIFO order between write and notify channel active Jan 18, 2024
…o make sure channel access thread-safe and avoid potential NPE
@tishun tishun added the type: bug A general bug label Oct 15, 2024
@@ -452,6 +450,7 @@ public void notifyChannelActive(Channel channel) {
}

sharedLock.doExclusive(() -> {
this.channel = channel;
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you roll-back all the other changes and leave out only this one then your test case still succeeds.

Can you elaborate on why you need them too?

@tishun tishun force-pushed the fix/make-sure-fifo-order-between-write-and-notifyChannelActive branch from d23c68f to 4fafb6e Compare October 15, 2024 14:27
@tishun tishun added the status: waiting-for-feedback We need additional information before we can continue label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-feedback We need additional information before we can continue type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FIFO order is not respected in DefaultEndpoint#notifyChannelActive()
2 participants