This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 236031 - Sample datasource deadlock
Summary: Sample datasource deadlock
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 7.4
Hardware: PC All
: P1 normal (vote)
Assignee: TomasKraus
URL:
Keywords: 7.4_HR_FIX, REGRESSION
: 230416 236235 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-16 13:47 UTC by Petr Hejl
Modified: 2013-09-23 09:34 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
thread dump (28.43 KB, text/plain)
2013-09-16 13:47 UTC, Petr Hejl
Details
thread dump (27.74 KB, text/plain)
2013-09-16 13:50 UTC, Petr Hejl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Hejl 2013-09-16 13:47:16 UTC
Created attachment 140131 [details]
thread dump

Found this while evaluating a maven issue.
Comment 1 Petr Hejl 2013-09-16 13:50:07 UTC
Created attachment 140132 [details]
thread dump

Different threads.
Comment 2 TomasKraus 2013-09-16 13:52:18 UTC
Well, yes, another school example of deadlock. :) Will try to fix ASAP.
Comment 3 TomasKraus 2013-09-17 13:30:47 UTC
This seems to be regression caused by Bug# 208447.

1st code path is coming from Hk2DeploymentManager.getCommonServerSupport() which was using Lookup to find GF server support API related to ServerInstance.
Here I did some changes to avoid using Lookup. CommonServerSupport and GlassfishInstance objects are linked together to see each other now (before there was only one way link from support to instance). So it's possible to retrieve CommonServerSupport trough GlassfishInstanceProvider API using server URI.
Guess it will be also bit faster to go stright trough URI -> GF instance Map.

2nd code path is going trough Hk2JavaEEPlatformImpl.getLookup() where lookup instance is being initialized inside synchronized(this) and [Hk2DeploymentManager].getCommonServerSupport().getInstance() was called from inside this block. This was closing loop in locks.
I removed lazy initialization of lookup instance so this is now done in constructor with no locking.

Deadlock conditions should be removed now.
Comment 4 TomasKraus 2013-09-17 13:35:01 UTC
Checked into web-main:
----------------------
changeset:   263832:c267c1426d63
summary:     #236031 - Deadlock condition removed
Comment 5 TomasKraus 2013-09-17 13:42:16 UTC
*** Bug 230416 has been marked as a duplicate of this bug. ***
Comment 6 TomasKraus 2013-09-17 14:12:47 UTC
Pushed in. Peter, please check your use case to see if deadlock is still there.
Comment 7 Petr Hejl 2013-09-18 09:23:33 UTC
(In reply to TomasKraus from comment #6)
> Pushed in. Peter, please check your use case to see if deadlock is still
> there.
Seems to be ok now.
Comment 8 Stepan Zebra 2013-09-20 12:21:41 UTC
(In reply to TomasKraus from comment #4)
> Checked into web-main:
> ----------------------
> changeset:   263832:c267c1426d63
> summary:     #236031 - Deadlock condition removed

verified by QE
Comment 9 TomasKraus 2013-09-20 12:31:12 UTC
7.4 release branch changeset:
-----------------------------
changeset:   272642:55119dc28300
branch:      release74
summary:     #236031 - Deadlock condition removed
Comment 10 TomasKraus 2013-09-23 09:34:38 UTC
*** Bug 236235 has been marked as a duplicate of this bug. ***