Re: RFR: 8238170: BeanContextSupport remove and propertyChange can deadlock

2023-01-25 Thread Paul Hohensee
On Tue, 24 Jan 2023 03:15:50 GMT, Sergey Bylokhov wrote: > Two methods in the BeanContextSupport class use two locks in a different > order, which can cause a deadlock. > > Here is the first order: (1) first acquire BeanContext.globalHierarchyLock > and then children: > > enter public me

Re: RFR: 8238170: BeanContextSupport remove and propertyChange can deadlock

2023-01-24 Thread Sergey Bylokhov
On Tue, 24 Jan 2023 20:12:44 GMT, Andrey Turbanov wrote: > Oof... Approach for synchronization in `BeanContextServicesSupport` is > confusing for me and inconsistent. Do you know why read access to `children` > is not syncrhonized in `java.beans.beancontext.BeanContextSupport#add` ? > > https:

Re: RFR: 8238170: BeanContextSupport remove and propertyChange can deadlock

2023-01-24 Thread Andrey Turbanov
On Tue, 24 Jan 2023 03:15:50 GMT, Sergey Bylokhov wrote: > Two methods in the BeanContextSupport class use two locks in a different > order, which can cause a deadlock. > > Here is the first order: (1) first acquire BeanContext.globalHierarchyLock > and then children: > > enter public me

RFR: 8238170: BeanContextSupport remove and propertyChange can deadlock

2023-01-24 Thread Sergey Bylokhov
Two methods in the BeanContextSupport class use two locks in a different order, which can cause a deadlock. Here is the first order: (1) first acquire BeanContext.globalHierarchyLock and then children: enter public method remove(Object) at line 484 call remove(Object, boolean) at line