Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] net4j reconnect session timeout exception, no reconnect
[CDO] net4j reconnect session timeout exception, no reconnect [message #1855557] Thu, 20 October 2022 11:25 Go to next message
thomas huster is currently offline thomas husterFriend
Messages: 21
Registered: June 2012
Junior Member
After the last target update to cdo version 4.19 the reconnecting cdo session throws the following exception if the connection to the server is lost, and no reconnect is happening afterwards.

The reconnect is working as expected with cdo version 4.12 .

Session configuration:
		// Repository
		ReconnectingCDOSessionConfiguration config = CDONet4jUtil.createReconnectingSessionConfiguration(serverAddress,
				configuration.repositoryName, IPluginContainer.INSTANCE);

		// Create credentials
		PasswordCredentialsProvider credentialsProvider = new PasswordCredentialsProvider(username, password);
		config.setCredentialsProvider(credentialsProvider);
		config.setActivateOnOpen(true);
		config.setPassiveUpdateEnabled(true);
		config.setPassiveUpdateMode(PassiveUpdateMode.ADDITIONS);
		config.setHeartBeatEnabled(true);
		try {
			setSession(config.openNet4jSession());
			getSession().addListener(new IListener() {

				@Override
				public void notifyEvent(final IEvent event) {
					if (event instanceof CDOSessionRecoveryEvent) {
						final CDOSessionRecoveryEvent recoveryEvent = (CDOSessionRecoveryEvent) event;
						switch (recoveryEvent.getType()) {
						case STARTED:
							sendEvent(EVENT_DISCONNECT);
							break;
						case FINISHED:
							sendEvent(EVENT_CONNECT);
							break;
						}
					}
				}
			});
		} catch (Exception e) {
			LoggerFactory.getLogger(getClass()).error("Error opening session to " + configuration.repositoryName, e);
			return false;
		}


Exception:
ERROR] org.eclipse.net4j.util.concurrent.TimeoutRuntimeException: Channel registration timeout after 10000 milliseconds
org.eclipse.net4j.channel.ChannelException: org.eclipse.net4j.util.concurrent.TimeoutRuntimeException: Channel registration timeout after 10000 milliseconds
	at org.eclipse.spi.net4j.ChannelMultiplexer.openChannel(ChannelMultiplexer.java:217)
	at org.eclipse.spi.net4j.ChannelMultiplexer.openChannel(ChannelMultiplexer.java:1)
	at org.eclipse.net4j.signal.SignalProtocol.open(SignalProtocol.java:229)
	at org.eclipse.net4j.signal.heartbeat.HeartBeatProtocol.<init>(HeartBeatProtocol.java:70)
	at org.eclipse.net4j.signal.heartbeat.HeartBeatProtocol.<init>(HeartBeatProtocol.java:75)
	at org.eclipse.net4j.signal.heartbeat.HeartBeatProtocol.<init>(HeartBeatProtocol.java:83)
	at org.eclipse.emf.cdo.internal.net4j.RecoveringCDOSessionImpl.createTCPConnector(RecoveringCDOSessionImpl.java:209)
	at org.eclipse.emf.cdo.internal.net4j.ReconnectingCDOSessionImpl.updateConnectorAndRepositoryName(ReconnectingCDOSessionImpl.java:88)
	at org.eclipse.emf.cdo.internal.net4j.RecoveringCDOSessionImpl.recoverSession(RecoveringCDOSessionImpl.java:232)
	at org.eclipse.emf.cdo.internal.net4j.RecoveringCDOSessionImpl.recover(RecoveringCDOSessionImpl.java:136)
	at org.eclipse.emf.cdo.internal.net4j.RecoveringCDOSessionImpl.recover(RecoveringCDOSessionImpl.java:128)
	at org.eclipse.emf.cdo.internal.net4j.RecoveringCDOSessionImpl.sessionProtocolDeactivated(RecoveringCDOSessionImpl.java:120)
	at org.eclipse.emf.internal.cdo.session.CDOSessionImpl$1.onDeactivated(CDOSessionImpl.java:201)
	at org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter.notifyLifecycleEvent(LifecycleEventAdapter.java:56)
	at org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter.notifyEvent(LifecycleEventAdapter.java:34)
	at org.eclipse.net4j.util.event.Notifier.fireEventSafe(Notifier.java:239)
	at org.eclipse.net4j.util.event.Notifier.fireEvent(Notifier.java:167)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.internalDeactivate(Lifecycle.java:146)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:184)
	at org.eclipse.emf.internal.cdo.session.DelegatingSessionProtocol$1.onDeactivated(DelegatingSessionProtocol.java:100)
	at org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter.notifyLifecycleEvent(LifecycleEventAdapter.java:56)
	at org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter.notifyEvent(LifecycleEventAdapter.java:34)
	at org.eclipse.net4j.util.event.Notifier.fireEventSafe(Notifier.java:239)
	at org.eclipse.net4j.util.event.Notifier.fireEvent(Notifier.java:167)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.internalDeactivate(Lifecycle.java:146)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:184)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:254)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:244)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:271)
	at org.eclipse.spi.net4j.Protocol.handleChannelDeactivation(Protocol.java:190)
	at org.eclipse.net4j.signal.SignalProtocol.handleChannelDeactivation(SignalProtocol.java:414)
	at org.eclipse.spi.net4j.Protocol$1.onDeactivated(Protocol.java:53)
	at org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter.notifyLifecycleEvent(LifecycleEventAdapter.java:56)
	at org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter.notifyEvent(LifecycleEventAdapter.java:34)
	at org.eclipse.net4j.util.event.Notifier.fireEventSafe(Notifier.java:239)
	at org.eclipse.net4j.util.event.Notifier.fireEvent(Notifier.java:167)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.internalDeactivate(Lifecycle.java:146)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:184)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:254)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:244)
	at org.eclipse.spi.net4j.ChannelMultiplexer.doDeactivate(ChannelMultiplexer.java:386)
	at org.eclipse.spi.net4j.Connector.doDeactivate(Connector.java:413)
	at org.eclipse.net4j.internal.tcp.TCPConnector.doDeactivate(TCPConnector.java:441)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.internalDeactivate(Lifecycle.java:132)
	at org.eclipse.net4j.util.lifecycle.ShareableLifecycle.internalDeactivate(ShareableLifecycle.java:52)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:184)
	at org.eclipse.net4j.internal.tcp.TCPConnector$1.run(TCPConnector.java:455)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.eclipse.net4j.util.concurrent.TimeoutRuntimeException: Channel registration timeout after 10000 milliseconds
	at org.eclipse.spi.net4j.ChannelMultiplexer.openChannel(ChannelMultiplexer.java:206)
	... 49 more
Caused by: org.eclipse.net4j.util.concurrent.TimeoutRuntimeException: Registration timeout after 10 000 milliseconds
	at org.eclipse.net4j.internal.tcp.ControlChannel.registerChannel(ControlChannel.java:101)
	at org.eclipse.net4j.internal.tcp.TCPConnector.registerChannelWithPeer(TCPConnector.java:386)
	at org.eclipse.spi.net4j.ChannelMultiplexer.openChannel(ChannelMultiplexer.java:200)
	... 49 more

[Updated on: Thu, 20 October 2022 11:49]

Report message to a moderator

Re: [CDO] net4j reconnect session timeout exception, no reconnect [message #1855558 is a reply to message #1855557] Thu, 20 October 2022 11:28 Go to previous messageGo to next message
thomas huster is currently offline thomas husterFriend
Messages: 21
Registered: June 2012
Junior Member
Had the same problem some time ago. https://www.eclipse.org/forums/index.php?t=msg&th=1092753&goto=1785300&#msg_1785300

This time the excpetion happens on the first reconnect, and the workaround
config.setSignalTimeout(Long.MAX_VALUE);

has no effect.

[Updated on: Thu, 20 October 2022 11:46]

Report message to a moderator

Re: [CDO] net4j reconnect session timeout exception, no reconnect [message #1855825 is a reply to message #1855558] Sun, 06 November 2022 06:55 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Thomas,

Our ReconnectingSessionTest.testReconnectTwice() is still green for me.
I've even added authentication and PassiveUpdate to that test case. I still can't reproduce your problem.
I fear you have to debug this yourself or provide more information that helps me modify the test case to make it fail...


Re: [CDO] net4j reconnect session timeout exception, no reconnect [message #1855947 is a reply to message #1855825] Thu, 10 November 2022 19:57 Go to previous messageGo to next message
thomas huster is currently offline thomas husterFriend
Messages: 21
Registered: June 2012
Junior Member
Hi Eike,

thanks for the reply. My Tests so far have shown that the Exception only occurs if the server is running on a remote host. No Exception and successful reconnect if its running on local host.

That is weird, and probably explains why the test is green.

Cheers,
Thomas
Re: [CDO] net4j reconnect session timeout exception, no reconnect [message #1855966 is a reply to message #1855947] Sat, 12 November 2022 16:38 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
But in both cases you're using TCP transport?
Can you predictably reproduce the problem?

I find your stacktrace interesting. According to it the TCP connection has already been re-established, but then the HeartBeatProtocol can't open a Channel through the TCPConnector. Perhaps there's something broken in the server?!



Re: [CDO] net4j reconnect session timeout exception, no reconnect [message #1856008 is a reply to message #1855966] Tue, 15 November 2022 13:59 Go to previous messageGo to next message
thomas huster is currently offline thomas husterFriend
Messages: 21
Registered: June 2012
Junior Member
Yes, I use the same server local and remote. A server restart is my test case, that takes more than 10 Sek.

The Exception occurs every time on the client side, if the remote server is restarted.

There is one TCP IAcceptor created by the server, for 3 CDO repositories.
			generalAcceptor = (IAcceptor) IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.acceptors", "tcp",
					"0.0.0.0:" + corePort);
Re: [CDO] net4j reconnect session timeout exception, no reconnect [message #1856058 is a reply to message #1856008] Thu, 17 November 2022 17:15 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
If you can reproduce this problem, do you have a chance to change the ReconnectingCDOSessionImpl.updateConnectorAndRepositoryName() a little bit and see if that resolves the problem?

There's a catch (ConnectorException ex) clause; can you change it to the following and retry?

catch (ConnectorException | ChannelException ex)


Re: [CDO] net4j reconnect session timeout exception, no reconnect [message #1856068 is a reply to message #1856058] Fri, 18 November 2022 12:30 Go to previous messageGo to next message
thomas huster is currently offline thomas husterFriend
Messages: 21
Registered: June 2012
Junior Member
I built a snapshot with the added ChannelException in the catch clause, and can confirm that it solves the issue.

Thanks for the hint.
Re: [CDO] net4j reconnect session timeout exception, no reconnect [message #1856069 is a reply to message #1856068] Fri, 18 November 2022 12:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Perfect, thank you so much for trying it out in a reproducing environment!

I'd like to apply that fix for CDO 4.21.0. Can you please submit a bugzilla?


Re: [CDO] net4j reconnect session timeout exception, no reconnect [message #1856071 is a reply to message #1856069] Fri, 18 November 2022 13:35 Go to previous messageGo to next message
thomas huster is currently offline thomas husterFriend
Messages: 21
Registered: June 2012
Junior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=581070

Thanks for maintaining CDO :)
Re: [CDO] net4j reconnect session timeout exception, no reconnect [message #1856073 is a reply to message #1856071] Fri, 18 November 2022 18:33 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
My pleasure ;-)

The fix will be in next week's RC1 drop.


Previous Topic:Xcore validation fails in Maven Release Build
Next Topic:[CDO] CDOStaleReferencePolicy & EMap
Goto Forum:
  


Current Time: Thu May 02 01:12:05 GMT 2024

Powered by FUDForum. Page generated in 0.04099 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top