Skip to content

Conversation

@ihrasko
Copy link
Collaborator

@ihrasko ihrasko commented Nov 6, 2025

We have hard-coded number of Netty threads to be 1 which is too limiting. Fix this.

We have hard-coded number of Netty threads to be 1 which is too
limiting. Fix this.

Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
@ihrasko ihrasko requested a review from Tobianas November 6, 2025 14:48
@ihrasko ihrasko marked this pull request as draft November 6, 2025 14:48
@gemini-code-assist
Copy link

Summary of Changes

Hello @ihrasko, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request initiates the process of making the number of Netty worker threads configurable, moving away from a restrictive hardcoded value. The change aims to improve the scalability and performance of the RESTCONF Netty server by allowing dynamic adjustment of thread resources, though full configurability is marked for future implementation.

Highlights

  • Netty Thread Configuration: The hardcoded number of Netty threads (previously 1) has been removed, addressing a limitation in the system's ability to scale.
  • Endpoint Implementation Change: The SimpleNettyEndpoint has been replaced with OSGiNettyEndpoint to facilitate more flexible configuration options for the Netty server.
  • Future Work Indication: A FIXME comment has been added to highlight the next steps required to fully implement configurable worker threads, including using RestconfBootstrapFactory and lighty.io configuration.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to make the number of Netty threads configurable by replacing SimpleNettyEndpoint with OSGiNettyEndpoint. However, the current changes are incomplete and introduce a compilation error because the bootstrapFactory variable is used without being defined. My review provides a fix to make the code compilable while respecting the intent to use Netty's default thread count, and also points out a minor issue in a comment.

* 2. create lighty.io config
* 2. hardcode 0 which is ODL netconf default allowing to use Netty default
*/
final var pros = OSGiNettyEndpoint.props(bootstrapFactory, configuration);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This line will not compile because the bootstrapFactory variable is not defined. You've removed the BootstrapFactory instantiation, but it's still required by OSGiNettyEndpoint.props().

To fix this, you need to create a BootstrapFactory instance before this line. Based on the FIXME comment, you likely want to use 0 threads to use Netty's default. You could add the following line before this one:

final var bootstrapFactory = new org.opendaylight.netconf.transport.tcp.BootstrapFactory("lighty-restconf-nb-worker", 0);

Note that you'll need to use the fully qualified name or re-add the import for BootstrapFactory.

*
* 1. use new RestconfBootstrapFactory(bootstrapFactoryConfig)
* 2. create lighty.io config
* 2. hardcode 0 which is ODL netconf default allowing to use Netty default

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a small typo in the numbering of this list; the second item 2. should probably be 3..

Suggested change
* 2. hardcode 0 which is ODL netconf default allowing to use Netty default
* 3. hardcode 0 which is ODL netconf default allowing to use Netty default

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

Successfully merging this pull request may close these issues.

1 participant