You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/08/28 06:31:10 UTC
[GitHub] [netbeans] JaroslavTulach opened a new pull request #3136: [NETBEANS-5914] Always call notifyAll() when changing value of the LOCK[0]
JaroslavTulach opened a new pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136
Visual inspection of `LazyLookupProviders` code suggests an inconsistency: `Object.wait()` waits on value of `LOCK[0]` and such value can be provided without setting calling `Object.notifyAll()`. This should be an easy fix for [this deadlock](https://issues.apache.org/jira/secure/attachment/13032558/13032558_12.5-beta2-threaddump-1629986898821.tdump).
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] JaroslavTulach edited a comment on pull request #3136: [NETBEANS-5914] Always call notifyAll() when changing value of the LOCK[0]
Posted by GitBox <gi...@apache.org>.
JaroslavTulach edited a comment on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-908032545
9227546 comes with a test and a fix to make sure the `delegates` lock isn't held when notifying changes. Guys, consider this for 12.5 beta3.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] neilcsmith-net commented on pull request #3136: [NETBEANS-5914] Always call notifyAll() when changing value of the LOCK[0]
Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-907755378
Yes, there's the one in `DelegatingLookupImpl`, and the one in `LazyLookupProviders` earlier in the above stack that is (effectively) under the lock here. Seems to be a deadlock between those two? I was reviewing this and trying to understand why it was hanging before the later call to `notifyAll()`.
https://github.com/apache/netbeans/blob/master/ide/projectapi/src/org/netbeans/modules/projectapi/LazyLookupProviders.java#L97
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] ebarboni merged pull request #3136: [NETBEANS-5914] Call notifyAll + avoid delivering changes under a lock
Posted by GitBox <gi...@apache.org>.
ebarboni merged pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] ebarboni commented on pull request #3136: [NETBEANS-5914] Call notifyAll + avoid delivering changes under a lock
Posted by GitBox <gi...@apache.org>.
ebarboni commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-909269969
Ok will merge
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] JaroslavTulach commented on pull request #3136: [NETBEANS-5914] Call notifyAll + avoid delivering changes under a lock
Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-908835922
Or better. Let's deliver events only when `LOCK[0] == null`: 5a44f56
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] JaroslavTulach commented on pull request #3136: [NETBEANS-5914] Always call notifyAll() when changing value of the LOCK[0]
Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-907622105
> is not the call to setLookups() a problem here as well
Possibly. _Git.cache_ thread holds the 0x00000000cf989738 lock:
```
at org.netbeans.spi.project.support.DelegatingLookupImpl.doDelegate(DelegatingLookupImpl.java:168)
- locked <0x00000000cf989738> (a java.util.ArrayList)
```
and many other threads are waiting for it.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] neilcsmith-net commented on pull request #3136: [NETBEANS-5914] Call notifyAll + avoid delivering changes under a lock
Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-908339527
> I don't think there is a problem in org.openide.util.lookup package. Feel free to write a test to prove I am wrong.
Neither do I. I think the problem is in `org.netbeans.modules.projectapi.LazyLookupProviders` and that [call to setLookups](https://github.com/apache/netbeans/blob/master/ide/projectapi/src/org/netbeans/modules/projectapi/LazyLookupProviders.java#L97) that is done holding the conditional lock.
I'll have a think about a test for that scenario if you need one, but it's what the stack trace seems to suggest ? ...
> Btw. I don't see any dump where lock are stuck in collectFires(). Please point me where you see something like that.
I mean the thread with the lock from DelegatingLookupImpl is stuck in collectFires() rather than in calling through to its listeners. eg. all the stack traces show the following similar (trimmed) stack, with resultChanged() being called in DelegatingLookupImpl fired under the lock from one LazyLookupProviders proxy, taking the lock in DelegatingLookupImpl, then waiting on the lock in another LazyLookupProviders proxy during a call to collectFires().
```
at org.netbeans.modules.projectapi.LazyLookupProviders$1Prov$1.beforeLookup(LazyLookupProviders.java:84)
- waiting to re-lock in wait() <0x0000000601a8dca0> (a [Ljava.lang.Thread;)
at org.openide.util.lookup.ProxyLookup.beforeLookup(ProxyLookup.java:268)
.....
at org.openide.util.lookup.ProxyLookup$R.collectFires(ProxyLookup.java:645)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:228)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:184)
at org.netbeans.spi.project.support.DelegatingLookupImpl.doDelegate(DelegatingLookupImpl.java:168)
- locked <0x0000000601a8ef08> (a java.util.ArrayList)
at org.netbeans.spi.project.support.DelegatingLookupImpl.resultChanged(DelegatingLookupImpl.java:84)
at org.openide.util.lookup.ProxyLookup$1Notify.run(ProxyLookup.java:239)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:248)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:184)
at org.netbeans.modules.projectapi.LazyLookupProviders$1Prov$1.beforeLookup(LazyLookupProviders.java:97)
```
Various of the other threads waiting on the lock in DelegatingLookupImpl are also being called under lock from a LazyLookupProvider proxy, presumably one of which is the one the above stack is waiting for. I'm not sure there's an easy way to ascertain which from a stack trace with this sort of conditional lock? I'd not even noticed it until I looked at your first commit here.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] JaroslavTulach commented on pull request #3136: [NETBEANS-5914] Call notifyAll + avoid delivering changes under a lock
Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-908259519
I don't think there is a problem in `org.openide.util.lookup` package. Feel free to write a test to prove I am wrong.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] neilcsmith-net commented on pull request #3136: [NETBEANS-5914] Call notifyAll + avoid delivering changes under a lock
Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-908237054
Doesn't this need the same change to take the notifications outside of the lock in `LazyLookupProviders`? Looking at the stack traces provided with NETBEANS-5914, all the threads with the `DelegatingLookupImpl` lock are stuck in `collectFires()` - that won't change with this will it? It's before the async notification - https://github.com/apache/netbeans/blob/master/platform/openide.util.lookup/src/org/openide/util/lookup/ProxyLookup.java#L228 They are all in a listener call from a `LazyLookupProvider` under lock though.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] ebarboni commented on pull request #3136: [NETBEANS-5914] Call notifyAll + avoid delivering changes under a lock
Posted by GitBox <gi...@apache.org>.
ebarboni commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-909269969
Ok will merge
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] JaroslavTulach edited a comment on pull request #3136: [NETBEANS-5914] Call notifyAll + avoid delivering changes under a lock
Posted by GitBox <gi...@apache.org>.
JaroslavTulach edited a comment on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-908259519
I don't think there is a problem in `org.openide.util.lookup` package. Feel free to write a test to prove I am wrong.
Btw. I don't see any dump where _lock are stuck in collectFires()_. Please point me where you see something like that.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] jtulach commented on pull request #3136: [NETBEANS-5914] Call notifyAll + avoid delivering changes under a lock
Posted by GitBox <gi...@apache.org>.
jtulach commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-908820088
Hello Neil, this is 3rd or 4th version of my reply. Sometimes I agree, sometimes I don't...
This PR clearly fixes [something](https://github.com/apache/netbeans/pull/3136/commits/9227546960199ecec44755a03cce6f1d59ade69d) (as shown by the test). Whether that is enough to address the problem of [this deadlock](https://issues.apache.org/jira/secure/attachment/13032558/13032558_12.5-beta2-threaddump-1629986898821.tdump):
```
at org.netbeans.modules.projectapi.LazyLookupProviders$1Prov$1.beforeLookup(LazyLookupProviders.java:84)
- locked <0x00000000cf989400> (a [Ljava.lang.Thread;)
at org.openide.util.lookup.ProxyLookup.beforeLookup(ProxyLookup.java:268)
```
remains to be seen. There is:
```
"org.netbeans.modules.project.ui.actions.LookupSensitiveAction" #51 daemon prio=1 os_prio=-2 cpu=46.88ms elapsed=78.28s tid=0x0000000031c145b0 nid=0x1f3c waiting for monitor entry [0x0000000047bce000]
java.lang.Thread.State: BLOCKED (on object monitor)
at org.netbeans.spi.project.support.DelegatingLookupImpl.doDelegate(DelegatingLookupImpl.java:100)
- waiting to lock <0x00000000cf989738> (a java.util.ArrayList)
at org.netbeans.spi.project.support.DelegatingLookupImpl.resultChanged(DelegatingLookupImpl.java:84)
at org.openide.util.lookup.ProxyLookup$1Notify.run(ProxyLookup.java:239)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:248)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:184)
at org.netbeans.modules.projectapi.LazyLookupProviders$1Prov$1.beforeLookup(LazyLookupProviders.java:97)
```
which would at the end notify the other waiters in `LazyLookupProviders$1Prov$1`. Right now it is blocked, but with changes in this PR it might become free. If not, then the next thing to tackle is
```
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:184)
at org.netbeans.spi.project.support.DelegatingLookupImpl.doDelegate(DelegatingLookupImpl.java:168)
- locked <0x00000000cf989738> (a java.util.ArrayList)
at org.netbeans.spi.project.support.DelegatingLookupImpl.resultChanged(DelegatingLookupImpl.java:84)
```
e.g. eliminate call to `setLookups` under the lock `0x00000000cf989738`.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] JaroslavTulach commented on pull request #3136: [NETBEANS-5914] Always call notifyAll() when changing value of the LOCK[0]
Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-908032545
9227546 comes with a test and a fix to make sure the `delegates` lock isn't held when notifying changes.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] neilcsmith-net commented on pull request #3136: [NETBEANS-5914] Call notifyAll + avoid delivering changes under a lock
Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-908339527
> I don't think there is a problem in org.openide.util.lookup package. Feel free to write a test to prove I am wrong.
Neither do I. I think the problem is in `org.netbeans.modules.projectapi.LazyLookupProviders` and that [call to setLookups](https://github.com/apache/netbeans/blob/master/ide/projectapi/src/org/netbeans/modules/projectapi/LazyLookupProviders.java#L97) that is done holding the conditional lock.
I'll have a think about a test for that scenario if you need one, but it's what the stack trace seems to suggest ? ...
> Btw. I don't see any dump where lock are stuck in collectFires(). Please point me where you see something like that.
I mean the thread with the lock from DelegatingLookupImpl is stuck in collectFires() rather than in calling through to its listeners. eg. all the stack traces show the following similar (trimmed) stack, with resultChanged() being called in DelegatingLookupImpl fired under the lock from one LazyLookupProviders proxy, taking the lock in DelegatingLookupImpl, then waiting on the lock in another LazyLookupProviders proxy during a call to collectFires().
```
at org.netbeans.modules.projectapi.LazyLookupProviders$1Prov$1.beforeLookup(LazyLookupProviders.java:84)
- waiting to re-lock in wait() <0x0000000601a8dca0> (a [Ljava.lang.Thread;)
at org.openide.util.lookup.ProxyLookup.beforeLookup(ProxyLookup.java:268)
.....
at org.openide.util.lookup.ProxyLookup$R.collectFires(ProxyLookup.java:645)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:228)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:184)
at org.netbeans.spi.project.support.DelegatingLookupImpl.doDelegate(DelegatingLookupImpl.java:168)
- locked <0x0000000601a8ef08> (a java.util.ArrayList)
at org.netbeans.spi.project.support.DelegatingLookupImpl.resultChanged(DelegatingLookupImpl.java:84)
at org.openide.util.lookup.ProxyLookup$1Notify.run(ProxyLookup.java:239)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:248)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:184)
at org.netbeans.modules.projectapi.LazyLookupProviders$1Prov$1.beforeLookup(LazyLookupProviders.java:97)
```
Various of the other threads waiting on the lock in DelegatingLookupImpl are also being called under lock from a LazyLookupProvider proxy, presumably one of which is the one the above stack is waiting for. I'm not sure there's an easy way to ascertain which from a stack trace with this sort of conditional lock? I'd not even noticed it until I looked at your first commit here.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] ebarboni commented on pull request #3136: [NETBEANS-5914] Call notifyAll + avoid delivering changes under a lock
Posted by GitBox <gi...@apache.org>.
ebarboni commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-909269969
Ok will merge
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] JaroslavTulach commented on pull request #3136: [NETBEANS-5914] Call notifyAll + avoid delivering changes under a lock
Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-908835922
Or better. Let's deliver events only when `LOCK[0] == null`: 5a44f56
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] jtulach commented on pull request #3136: [NETBEANS-5914] Call notifyAll + avoid delivering changes under a lock
Posted by GitBox <gi...@apache.org>.
jtulach commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-908820088
Hello Neil, this is 3rd or 4th version of my reply. Sometimes I agree, sometimes I don't...
This PR clearly fixes [something](https://github.com/apache/netbeans/pull/3136/commits/9227546960199ecec44755a03cce6f1d59ade69d) (as shown by the test). Whether that is enough to address the problem of [this deadlock](https://issues.apache.org/jira/secure/attachment/13032558/13032558_12.5-beta2-threaddump-1629986898821.tdump):
```
at org.netbeans.modules.projectapi.LazyLookupProviders$1Prov$1.beforeLookup(LazyLookupProviders.java:84)
- locked <0x00000000cf989400> (a [Ljava.lang.Thread;)
at org.openide.util.lookup.ProxyLookup.beforeLookup(ProxyLookup.java:268)
```
remains to be seen. There is:
```
"org.netbeans.modules.project.ui.actions.LookupSensitiveAction" #51 daemon prio=1 os_prio=-2 cpu=46.88ms elapsed=78.28s tid=0x0000000031c145b0 nid=0x1f3c waiting for monitor entry [0x0000000047bce000]
java.lang.Thread.State: BLOCKED (on object monitor)
at org.netbeans.spi.project.support.DelegatingLookupImpl.doDelegate(DelegatingLookupImpl.java:100)
- waiting to lock <0x00000000cf989738> (a java.util.ArrayList)
at org.netbeans.spi.project.support.DelegatingLookupImpl.resultChanged(DelegatingLookupImpl.java:84)
at org.openide.util.lookup.ProxyLookup$1Notify.run(ProxyLookup.java:239)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:248)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:184)
at org.netbeans.modules.projectapi.LazyLookupProviders$1Prov$1.beforeLookup(LazyLookupProviders.java:97)
```
which would at the end notify the other waiters in `LazyLookupProviders$1Prov$1`. Right now it is blocked, but with changes in this PR it might become free. If not, then the next thing to tackle is
```
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:184)
at org.netbeans.spi.project.support.DelegatingLookupImpl.doDelegate(DelegatingLookupImpl.java:168)
- locked <0x00000000cf989738> (a java.util.ArrayList)
at org.netbeans.spi.project.support.DelegatingLookupImpl.resultChanged(DelegatingLookupImpl.java:84)
```
e.g. eliminate call to `setLookups` under the lock `0x00000000cf989738`.
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] neilcsmith-net commented on pull request #3136: [NETBEANS-5914] Always call notifyAll() when changing value of the LOCK[0]
Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on pull request #3136:
URL: https://github.com/apache/netbeans/pull/3136#issuecomment-907612524
In theory was the call to `notifyAll()` at line 107 assumed to cover all bases? While this is probably a good change, is not the call to `setLookups()` a problem here as well as it's effectively holding a lock and firing listeners? Should they both be passing an executor, possibly a single one, to fire listeners async?
eg. one of the stack traces has this -
```
at java.lang.Object.wait(java.base@11.0.11/Object.java:328)
at org.netbeans.modules.projectapi.LazyLookupProviders$1Prov$1.beforeLookup(LazyLookupProviders.java:84)
- waiting to re-lock in wait() <0x0000000099880000> (a [Ljava.lang.Thread;)
at org.openide.util.lookup.ProxyLookup.beforeLookup(ProxyLookup.java:268)
....
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:184)
at org.netbeans.spi.project.support.DelegatingLookupImpl.doDelegate(DelegatingLookupImpl.java:168)
- locked <0x0000000099880458> (a java.util.ArrayList)
at org.netbeans.spi.project.support.DelegatingLookupImpl.resultChanged(DelegatingLookupImpl.java:84)
at org.openide.util.lookup.ProxyLookup$1Notify.run(ProxyLookup.java:239)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:248)
at org.openide.util.lookup.ProxyLookup.setLookups(ProxyLookup.java:184)
at org.netbeans.modules.projectapi.LazyLookupProviders$1Prov$1.beforeLookup(LazyLookupProviders.java:97)
```
--
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: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists