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

LittleProxy leaves non-daemon thread if it fails to start because of a port already in use #438

Open
suzukieng opened this issue May 6, 2020 · 0 comments

Comments

@suzukieng
Copy link

If LittleProxy is started and a port that is already in use is specified, a RuntimeException wrapping the BindException will be thrown (see stack trace below).

That's fine, but what shouldn't be IMHO is that leaves a non-daemon thread behind, in this case the thread named "LittleProxy-0-ClientToProxyAcceptor-0".

This will prevent an orderly JVM shutdown.

Screenshot 2020-05-06 at 17 12 57

at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
	at sun.nio.ch.Net.bind(Net.java:455) ~[?:?]
	at sun.nio.ch.Net.bind(Net.java:447) ~[?:?]
	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227) ~[?:?]
	at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:128) ~[netty-all-4.0.44.Final.jar:?]
	at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:501) ~[netty-all-4.0.44.Final.jar:?]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1218) ~[netty-all-4.0.44.Final.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:496) ~[netty-all-4.0.44.Final.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:481) ~[netty-all-4.0.44.Final.jar:?]
	at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:965) ~[netty-all-4.0.44.Final.jar:?]
	at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:210) ~[netty-all-4.0.44.Final.jar:?]
	at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:355) ~[netty-all-4.0.44.Final.jar:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:399) ~[netty-all-4.0.44.Final.jar:?]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:446) ~[netty-all-4.0.44.Final.jar:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131) ~[netty-all-4.0.44.Final.jar:?]
	at java.lang.Thread.run(Thread.java:834) ~[?:?]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant