Skip to content

feat(genkit): implement reflection server port retry range#197

Open
MichaelDoyle wants to merge 1 commit into
mainfrom
feat-reflection-port-range
Open

feat(genkit): implement reflection server port retry range#197
MichaelDoyle wants to merge 1 commit into
mainfrom
feat-reflection-port-range

Conversation

@MichaelDoyle
Copy link
Copy Markdown
Contributor

Implement port retry range (basePort..basePort+100) for reflection server startup, aligning behavior with TypeScript and Go SDKs.

Copy link
Copy Markdown

@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 implements a port-probing mechanism for the reflection server, allowing it to attempt starting on a range of ports (basePort to basePort + 100) if the initial port is occupied. The review feedback identifies several critical issues: a potential NullPointerException in the error handling logic, incorrect port reporting when using port 0 (ephemeral ports), and a recommendation to use local variables for the server instance during the retry loop to ensure state consistency and safer cleanup.

Comment thread genkit/src/main/java/com/google/genkit/ReflectionServer.java
@MichaelDoyle MichaelDoyle force-pushed the feat-reflection-port-range branch from 5f50c09 to 5ae2ea8 Compare May 20, 2026 19:49
@MichaelDoyle MichaelDoyle requested a review from xavidop May 20, 2026 19:50
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.

2 participants