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

Implement immediateStop in HTTP listener #1794

Closed
Assignees
Labels

Comments

@Bhashinee
Copy link
Member

Description:
Currently, the listener's immediateStop method is not implemented. Need to do a feasibility study on this.

@Bhashinee
Copy link
Member Author

In the implementation, as per the current design, we are using a shared boss and worker EventLoopGroups over all the listeners as well as clients.

As per Netty documentation, in order to shut down a Netty application, you need to shut down the EventLoopGroup. As we have been sharing this eventloop group among other listeners and clients, it is not possible to shutdown it immediately.

It is not possible to create eventloopgroups per listener as it can result in an issue similar to this.

@Bhashinee Bhashinee added module/http Team/PCM Protocol connector packages related issues labels Aug 23, 2021
@shafreenAnfar
Copy link
Contributor

I think what we need to do is instead of sharing the EventLoop group, we should share the thread pool. It seems we can do that by sharing a thread executor pool.

https://github.com/netty/netty/blob/4.1/transport/src/main/java/io/netty/channel/nio/NioEventLoopGroup.java#L72

@chamil321
Copy link
Contributor

I think what we need to do is instead of sharing the EventLoop group, we should share the thread pool. It seems we can do that by sharing a thread executor pool.

https://github.com/netty/netty/blob/4.1/transport/src/main/java/io/netty/channel/nio/NioEventLoopGroup.java#L72

Once the suggestion was implemented(Share instead of EventLoop group), local build facing Too many open files issue. According to a similar issue[1], this behaviour is seen when multiple event loop groups were created.

[1] netty/netty#639 (comment)

@chamil321
Copy link
Contributor

I think what we need to do is instead of sharing the EventLoop group, we should share the thread pool. It seems we can do that by sharing a thread executor pool.
https://github.com/netty/netty/blob/4.1/transport/src/main/java/io/netty/channel/nio/NioEventLoopGroup.java#L72

Once the suggestion was implemented(Share instead of EventLoop group), local build facing Too many open files issue. According to a similar issue[1], this behaviour is seen when multiple event loop groups were created.

[1] netty/netty#639 (comment)

As the proper solution, closed the socket pipeline of the server channel initializer after sharing the Eventloop groups again.

Sorted #2990

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment