Skip to content

Guard against duplicate read completion callbacks - #37426

Open
rydzwr wants to merge 1 commit into
spring-projects:mainfrom
rydzwr:gh-37377-double-release
Open

rydzwr wants to merge 1 commit into
spring-projects:mainfrom
rydzwr:gh-37377-double-release

Conversation

@rydzwr

@rydzwr rydzwr commented Oct 8, 2026

Copy link
Copy Markdown

On Windows, WindowsAsynchronousFileChannelImpl can call the completion
handler a second time for the same read after EOF, when the channel is
closed. ReadCompletionHandler then releases the same DataBuffer twice.

This adds a once-only flag to the read Attachment and sets DISPOSED
before closing the channel.

Closes gh-37377

On Windows the completion handler can be invoked twice for the same
read after EOF, which released the DataBuffer twice.

Closes spring-projectsgh-37377

Signed-off-by: Kacper Rydzyński <rydzwr@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 8, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged or decided on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataBufferUtils.readAsynchronousFileChannel() may release DataBuffer more than once on Windows

2 participants