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

Conversation

okg-cxf
Copy link
Contributor

@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
@tishun tishun added the type: bug A general bug label Oct 15, 2024
@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
okg-cxf and others added 2 commits December 6, 2024 17:36
…o make sure channel access thread-safe and avoid potential NPE
@tishun tishun force-pushed the fix/make-sure-fifo-order-between-write-and-notifyChannelActive branch from 76db95a to b4f5d7d Compare December 6, 2024 15:54
@tishun tishun merged commit b76f985 into redis:main Dec 6, 2024
4 checks passed
thachlp pushed a commit to thachlp/lettuce that referenced this pull request Dec 31, 2024
…dis#2597)

* fix: make sure FIFO order for write() when notifyChannelActive(), also make sure channel access thread-safe and avoid potential NPE

* Formatting issues

---------

Co-authored-by: Tihomir Mateev <[email protected]>
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