reta opened a new pull request, #3475:
URL: https://github.com/apache/cxf/pull/3475

   Race Condition in ServerLifeCycleManagerImpl#stopServer()
   
   ```
   java.lang.IndexOutOfBoundsException: Index: 3, Size: 2
    at 
java.base/java.util.concurrent.CopyOnWriteArrayList.listIterator(CopyOnWriteArrayList.java:1151)
    at 
org.apache.cxf.bus.managers.ServerLifeCycleManagerImpl.stopServer(ServerLifeCycleManagerImpl.java:66)
    at org.apache.cxf.endpoint.ServerImpl.stop(ServerImpl.java:177)
   ```
   
   So two things at play here:
    - `listeners.listIterator` is safe, no need to synchronize (coming from 
Javadocs)
    - but because we iterate in reverse, there is a race between  
`listeners.listIterator` and `listeners.size`
    - fixed that by cloning (== snapshoting)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to