jetty.project/jetty-http
Joakim Erdfelt 43eb08b146
Backport #10540 to `jetty-10.0.x` Fixed deadlock in class initialization. (#10545)
* Fixed deadlock in class initialization. (#10540)

* Thread T1 may initialize HttpTester.Message that extends MutableHttpFields, so grabs the lock for the initialization of class MutableHttpFields.
* Thread T2 may initialize HttpFields, so grabs the lock for HttpFields and initializes field EMPTY, which calls new MutableHttpFields.
* To initialize MutableHttpFields, T1 must initialize HttpFields, but sees that its lock is taken and waits.
* To initialize HttpFields, T2 must create an instance and therefore initialize MutableHttpFields, but sees that its lock is taken and waits.
* Deadlock.

The solution is to use another class, EmptyHttpFields, to initialize HttpFields.EMPTY, so that there is no deadlock.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-18 13:00:11 -05:00
..
src Backport #10540 to `jetty-10.0.x` Fixed deadlock in class initialization. (#10545) 2023-09-18 13:00:11 -05:00
pom.xml Updating to version 10.0.17-SNAPSHOT 2023-08-25 14:27:38 -05:00