Repository navigation
Conversation
NorthArea
force-pushed
the
northarea/send-close-as-closed
branch
from
November 6, 2026 07:29
da535cf to
f679103
Compare
2 of 6 tasks
NorthArea
force-pushed
the
northarea/send-close-as-closed
branch
2 times, most recently
from
November 6, 2026 10:15
bb630b3 to
47731ca
Compare
A request could pass the READY check in send() and be written after close() had closed the channel. Its future then failed with a netty StacklessClosedChannelException, and ConnectionToTarantoolTest testSendAndReceiveWithConcurrentClose, which expects the root cause to be ConnectionClosedException, failed in CI from time to time. When the connection has a close reason, the send failure now has ConnectionClosedException with that reason as its root cause; the netty error is kept as suppressed. SendCloseRaceTest holds the event loop, sends a request and closes the connection on the event loop before the write runs. Without the fix it fails with StacklessClosedChannelException.
NorthArea
force-pushed
the
northarea/send-close-as-closed
branch
from
November 6, 2026 11:19
47731ca to
0419800
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ConnectionToTarantoolTest.testSendAndReceiveWithConcurrentClosefails in CI from time to time (at least 5 times on 28.10–05.11, both box-integration jobs): it expects the root causeConnectionClosedExceptionand gets netty'sStacklessClosedChannelException.Cause. A request passes the
READYcheck inConnectionImpl.send(), thenclose()closes the channel before netty writes it. The write fails with netty's error, while requests waiting for a response on the same close fail withConnectionClosedException.fix(core): report send racing close as closed— if a write fails and the connection already has a close reason, the root cause isConnectionClosedExceptionwith that reason; the netty error is kept as suppressed.SendCloseRaceTestreproduces the race every time.Stand:
SendCloseRaceTest3/3 failed without the fix, 10/10 passed with it;ConnectionToTarantoolTest15/15 on 3.5.0, 5/5 on 2.11.8;verifyandspotless:checkpass.#131 keeps the same expectation in this test (and makes it stricter) but does not change
send(); this fix satisfies it.ConnectionToTarantoolTest.testSendAndReceiveWithConcurrentCloseвремя от времени падает в CI (не меньше 5 раз за 28.10–05.11, оба задания box-integration): ждёт первопричинуConnectionClosedException, а получаетStacklessClosedChannelExceptionnetty.Причина. Запрос проходит проверку
READYвConnectionImpl.send(), затемclose()закрывает канал до того, как netty его запишет. Запись падает с ошибкой netty, а запросы, ждущие ответа, при том же закрытии падают сConnectionClosedException.fix(core): report send racing close as closed— если запись не удалась, а у соединения уже есть причина закрытия, первопричина —ConnectionClosedExceptionс этой причиной; ошибка netty сохраняется как suppressed.SendCloseRaceTestвоспроизводит гонку каждый раз.Стенд:
SendCloseRaceTestбез исправления 3/3 упал, с исправлением 10/10 прошёл;ConnectionToTarantoolTest15/15 на 3.5.0, 5/5 на 2.11.8;verifyиspotless:checkпроходят.#131 сохраняет в этом тесте то же ожидание (и делает его строже), но
send()не меняет; это исправление ему удовлетворяет.I haven't forgotten about: