Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to close a Publication on channel conflict #456

Closed
mjpt777 opened this issue Jan 19, 2018 · 3 comments
Closed

Need to close a Publication on channel conflict #456

mjpt777 opened this issue Jan 19, 2018 · 3 comments

Comments

@mjpt777
Copy link
Contributor

mjpt777 commented Jan 19, 2018

If a port conflict, or the like, occurs when a publication is set up with a clashing channel then it gets a repeated error while trying to send a setup message as below. We need a means of cleaning up channels and their associated publications and subscriptions when socket errors occur.

java.nio.channels.NotYetConnectedException
	at sun.nio.ch.DatagramChannelImpl.write(DatagramChannelImpl.java:596)
	at io.aeron.driver.media.SendChannelEndpoint.send(SendChannelEndpoint.java:195)
	at io.aeron.driver.NetworkPublication.setupMessageCheck(NetworkPublication.java:534)
	at io.aeron.driver.NetworkPublication.send(NetworkPublication.java:245)
	at io.aeron.driver.Sender.doSend(Sender.java:163)
	at io.aeron.driver.Sender.doWork(Sender.java:89)
	at org.agrona.concurrent.AgentRunner.doDutyCycle(AgentRunner.java:233)
	at org.agrona.concurrent.AgentRunner.run(AgentRunner.java:159)
	at java.lang.Thread.run(Thread.java:748)
@mjpt777 mjpt777 added the bug label Jan 19, 2018
@tmontgomery
Copy link
Contributor

The NotYetConnectedException is the result of trying to send after a conflict on the publication side. This can also happen if the OS hasn't been connected for a couple reasons. So, we can't simply stop on this particular exception as it can be spurious.

However, this particular exception should be caught and ignored on sending.

@tmontgomery
Copy link
Contributor

Some now handled by 1b43785 to reduce number of exceptions.

@tmontgomery
Copy link
Contributor

In addition, we should add in a force close command response so that a Publication/Subscription/Counter can be forcibly closed by the driver and the client informed. In addition, this response could be used to inform the client of a driver being shutdown.

mjpt777 added a commit that referenced this issue Nov 11, 2018
@mjpt777 mjpt777 closed this as completed Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants