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.
Summary: | 4.2s - j2ee.deployment.impl.Server.getOptionalFactory() | ||
---|---|---|---|
Product: | serverplugins | Reporter: | Exceptions Reporter <exceptions_reporter> |
Component: | GlassFish | Assignee: | Petr Hejl <phejl> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ivasen, stezeb |
Priority: | P3 | Keywords: | PERFORMANCE |
Version: | 7.3 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | 197972 |
Attachments: | nps snapshot |
Description
Exceptions Reporter
2013-01-25 04:35:18 UTC
Created attachment 130614 [details]
nps snapshot
There are two things: 1) Maybe the GF should register optional factory via org.netbeans.modules.j2ee.deployment.plugins.spi.support.ProxyOptionalFactory. I'm not sure about side effects such as race condition in initialization. 2) GlassfishInstance.hashCode() is touching the disk. Actually not just touching - it is copying stuff. public int hashCode() { StringBuilder sb = new StringBuilder( getDeployerUri().replace("127.0.0.1", "localhost")); sb.append(getHttpPort()); sb.append(getDomainsRoot()); sb.append(getDomainName()); return sb.toString().hashCode(); } This looks quite safe when you look at it. But getDomainsRoot() can initialize new domains root when the one registered in GF is read only and it has to initialize whole GF domain. So yes, this is bad. Displayname is 100% unique so maybe it's safe enough to use this String to generate hash. The only problem is, that those strings are usually very similar (their code distance is very low). String hash is being computed as s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1] so this seems to be safe - it usually differs at the end and looks like this method will guarantee some spread of those values. I'll change it to String hash from display name. I see GlassfishInstance.loadServerInstances as the most critical part of this snapshot. What will this optional factory registration do? We need to kick GlassfishInstanceProvider somehow and the best place is some asynchronous task far from AWT thread. This is the same as Bug# 233869 - I added you into cc list - asynchronous access to GlassfishInstanceProvider before anythyng else touches it would help. 2) is fixed, checked int web-main: ---------------------------------- changeset: 260328:f17b5b02564a summary: #225314 - GlassfishInstance#hashCode() rewritten to use server display name which is mandatory and unique Integrated into 'main-silver', will be available in build *201308062300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/f17b5b02564a User: Tomas Kraus <TomasKraus@netbeans.org> Log: #225314 - GlassfishInstance#hashCode() rewritten to use server display name which is mandatory and unique #1 has been fixed recently in another issue. |