Encountered repeated deadlocks between a thread handling GET /view/something/:
at hudson.model.View.getProperties(View.java:258) - waiting to lock <0x00000000c944da28> (a hudson.plugins.view.dashboard.Dashboard) at <some AuthorizationStrategy>.getACL(…) at hudson.model.View.getACL(View.java:495) at hudson.model.View.hasPermission(View.java:503) at hudson.model.ViewGroupMixIn.getViews(ViewGroupMixIn.java:115) at jenkins.model.Jenkins.getViews(Jenkins.java:1406) - locked <0x00000000c7e605f8> (a hudson.model.Hudson) …
and a thread handling POST /view/somethingelse/createItem:
at jenkins.model.Jenkins.save(Jenkins.java:2551) - waiting to lock <0x00000000c7e605f8> (a hudson.model.Hudson) at hudson.model.ListView.doCreateItem(ListView.java:202) - locked <0x00000000c944da28> (a hudson.plugins.view.dashboard.Dashboard) …
Unclear whether the authorization plugin should be restricted in what it may call during getACL (in this case there is no apparent way to avoid using View.getProperties), but that aside:
- Jenkins.getViews is synchronized for no clear reason. Other methods working on viewGroupMixIn such as addView are not; and views is already a CopyOnWriteArrayList which ought to thread-safe.
- View.getProperties synchronizes on this when it could use a finer-grained lock.