Skip to content

Corba refactoring, ORB updated to 5.0.1#25804

Merged
dmatej merged 1 commit into
eclipse-ee4j:mainfrom
dmatej:corba
May 4, 2026
Merged

Corba refactoring, ORB updated to 5.0.1#25804
dmatej merged 1 commit into
eclipse-ee4j:mainfrom
dmatej:corba

Conversation

@dmatej
Copy link
Copy Markdown
Contributor

@dmatej dmatej commented Nov 24, 2025

  • Rebased work to More flexibility to control server start #25790
  • Originally I had no time to finished that and those race conditions were quite rare, but in More flexibility to control server start #25790 they became very noisy.
  • The main problem is very bad design of CORBA-ORB modules and the initialization of this feature. It is easy to get into a recursion of failures causing a StackOverflowl.
  • Yet before an hour it was happening with glassfish-static, when it restarted, and old one did not manage to close listeners before the new one tried to enable them. Before this change it was more often a race condition causing an exception, but which did not end in never ending root.
  • However now I cannot reproduce it any more, I guess CI has to try it too.

This is what I am running locally. The ejb_group_2 is another option.

./rm-generated.sh && mvn clean install -Pfastest -T4C && ./runtests.sh ejb_group_embedded

Depends On


AI-generated summary of changes

Here's the grouped summary of changes across 88 files:

CI/Build (Jenkinsfile, .github/workflows/*.yml, gftest.sh, pom.xml files)
Added -Psnapshots Maven profile to all CI build commands, and bumped glassfish-corba.version from 5.0.0 to 5.1.0-SNAPSHOT in nucleus/parent/pom.xml.

Core architectural change: GlassFishORBHelper deleted, replaced by GlassFishORBLocator + OrbInitializationNode
GlassFishORBHelper.java and GlassFishORBLifeCycleListener.java are fully removed. A new GlassFishORBLocator replaces the helper with cleaner ORB lifecycle management, proper failure tracking, and thread-local support for partially-initialized ORB during startup. A new OrbInitializationNode singleton holds the acceptor delegate to break a cyclic HK2 dependency.

ORB creation refactored: GlassFishORBManagerOrbCreator + GlassFishOrbImpl
GlassFishORBManager is massively simplified — ORB creation logic extracted into a new OrbCreator class. A new GlassFishOrbImpl extends ORBImpl directly (instead of using ORBFactory), and is now the registered ORB class (org.omg.CORBA.ORBClass). This fixes the ORB restart bug from 2024, introduced by commit 6f6b961.

Lazy ORB service: ORBLazyServiceInitializer replaced by ORBLazyService
New implementation uses OrbInitializationNode.canHandleRequest() instead of the old SelectableChannelDelegate, with a spin-wait loop and deadlock detection/logging.

GlassFishORBFactory interface cleaned up
Removed getCSIv2PolicyType(), getORBHost(), getORBPort(). Added getEjbDescriptor(IORInfo) to move EJB descriptor lookup out of CSIV2TaggedComponentInfo. ORBLocator interface also drops getORBPort()/getORBHost().

All consumers migrated from GlassFishORBHelper to GlassFishORBLocator or ORBLocator
Affects: EjbContainerUtil, EjbContainerUtilImpl, BaseContainer, EJBObjectInputStreamHandler, EJBObjectOutputStreamHandler, EjbNamingReferenceManagerImpl, MessageBeanContainer, SecurityContextUtil, SecurityMechanismSelector, SecIORInterceptor, SecClientRequestInterceptor, SecServerRequestInterceptor, SecurityIIOPInterceptorFactory, TransactionServerInterceptor, TransactionInterceptorFactory, TransactionIIOPInterceptorFactory, TxIORInterceptor, TransactionServiceProperties, ORBNamingProxy, AppClientContainerBuilder, TargetServerHelper.

IIOPSSLUtil interface cleaned up
Removed getAppClientSSL()/setAppClientSSL() (app client SSL now goes through SSLUtils directly). Method signatures use concrete types instead of Object.

IIOPUtils cleaned up
Removed static singleton pattern (getInstance()/setInstance()), removed setORB()/getORB(), removed GlassFishORBLifeCycleListener support. Now uses Globals.get() for lookup.

CSIV2TaggedComponentInfo and SecIORInterceptor refactored
getEjbDescriptor() moved to GlassFishORBFactory. createSecurityTaggedComponent(int sslPort) now takes explicit Properties instead of fetching from orbHelper. SecIORInterceptor now injects GlassFishORBLocator directly.

PEORBConfigurator simplified
Removed static threadpoolMgr and setThreadPoolManager(). Thread pool is now set directly from S1ASThreadPoolManager. setORB() callback to GlassFishORBHelper removed; replaced with GlassFishORBLocator.setThreadLocal(orb).

MessageBeanContainer: Removed explicit initializeProtocolManager() call — ORB is now initialized lazily on demand.

AppClientDeployer: Added null check before clearArtifacts() to fix NPE.

AppClientHTTPAdapter: Replaced NPE-catching workaround with null check on getIIOPEndpoints() result.

Tests: Replaced hardcoded "localhost" with NetUtils.getHostName() in IIOP listener tests. Updated ORB class references from com.sun.corba.ee.impl.orb.ORBImpl to GlassFishOrbImpl in standalone client tests.

Misc cleanup across many files: StringBufferStringBuilder, raw types → generics, java.util.loggingSystem.Logger, removed dead code, added @Override annotations, e.printStackTrace() → proper logging.

@dmatej dmatej force-pushed the corba branch 2 times, most recently from e4d5cc5 to ae5e0d2 Compare November 25, 2025 03:43
@dmatej
Copy link
Copy Markdown
Contributor Author

dmatej commented Nov 25, 2025

FIXME: In #25790 I have collided with incorrect CORBA lifecycle, which can leave "zombie ports" open after shutdown. I added just some fixme to the code, and three partial workarounds to avoid it. Part of the problem could be also tests which probably don't close sockets too. The server part should be addressed in this PR - as I already refactored it a lot, it should be easier to add those sockets to some list, so they could be safely closed regardless on which other threads are using them.
Starts+stops+restarts are faster and faster, that makes the old tech debt crawling like a zombie. I added few bugs too.

@dmatej dmatej force-pushed the corba branch 5 times, most recently from 14a8fe1 to 355474a Compare December 2, 2025 05:11
@dmatej dmatej force-pushed the corba branch 5 times, most recently from f635b9f to dbb9566 Compare December 11, 2025 21:00
@pzygielo pzygielo changed the base branch from master to main January 5, 2026 11:56
@dmatej dmatej force-pushed the corba branch 4 times, most recently from 4585886 to 87422cf Compare April 11, 2026 16:34
@dmatej dmatej force-pushed the corba branch 2 times, most recently from ebeee10 to e518f9d Compare April 16, 2026 12:56
@dmatej dmatej marked this pull request as ready for review April 16, 2026 21:20
@dmatej dmatej marked this pull request as draft April 16, 2026 21:20
@dmatej
Copy link
Copy Markdown
Contributor Author

dmatej commented Apr 16, 2026

@eclipse-ee4j/ee4j-glassfish-committers you can review, just don't merge it until we release new corba-orb lib.

@dmatej dmatej added this to the 8.0.2 milestone Apr 16, 2026
@dmatej dmatej requested a review from a team April 16, 2026 21:22
@dmatej
Copy link
Copy Markdown
Contributor Author

dmatej commented May 1, 2026

The last failing test is fixed here:

- Fixed bug I made in 2024-02 in 6f6b961 which
  destroyed ORB restarts.

Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
@dmatej dmatej marked this pull request as ready for review May 4, 2026 15:06
@dmatej dmatej merged commit 2db777b into eclipse-ee4j:main May 4, 2026
5 of 6 checks passed
@dmatej dmatej deleted the corba branch May 4, 2026 17:03
@OndroMih OndroMih changed the title Corba refactoring Corba refactoring, ORB updated to 5.0.1 May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants