Skip to content

WSOC : Race condition in HttpDispatcherLink causes "Request not read yet" IOException during WebSocket connection closure #33931

@seshadhri-aswath

Description

@seshadhri-aswath

Describe the bug
A race condition exists between HttpDispatcherLink.destroy() and HttpDispatcherLink.finish() methods that causes an IOException: Request not read yet when WebSocket connections are closed. This occurs when one thread destroys the connection objects while another thread is still completing the HTTP respons

The race condition occurs between two concurrent operations:

Thread A (WebSocket destruction path):
Calls HttpDispatcherLink.destroy(Exception e)
Sets this.isc = null
Nullifies other connection references

Thread B (HTTP response completion path):
Executing HttpDispatcherLink.finish(Exception e)
Calls closeStreams() which attempts to use the ISC
ISC has been nullified by Thread A → throws IOException

Steps to Reproduce
Not easily reproducible

Expected behavior
Connection lifecycle methods should handle concurrent calls gracefully without throwing exceptions.

Diagnostic information:

  • OpenLiberty Version: 26.0.0.1
  • Java Version: 21.0.9

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions