Skip to content

collection/rpc: convert RPC engine to component.Component #7726

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Aug 13, 2025

collection/rpc: convert RPC engine to component.Component

Summary

  • Replace legacy engine.Unit lifecycle with component.Component managed by ComponentManager.
  • Add workers:
    • serveGRPCWorker: bind listen address, signal ready after successful bind, then grpc.Serve.
    • shutdownWorker: wait for shutdown and call GracefulStop.
  • Preserve existing API registration, metrics, interceptors, and rate limiting.
  • No changes to error messages unless necessary.

Readiness semantics

  • Ready is signaled only after binding to the listen address succeeds, matching patterns used in other engines.

Links and attribution

Verification

  • make lint passed locally.
  • go build ./... succeeded.

Notes

  • Engine now implements component.Component and remains compatible with module.ReadyDoneAware-based builders.

…entManager workers (serve + shutdown); preserve metrics and rate limiting

Co-Authored-By: peter.argue@flowfoundation.org <peter.argue@flowfoundation.org>
@devin-ai-integration devin-ai-integration bot requested a review from a team as a code owner August 13, 2025 14:45
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2025

Codecov Report

❌ Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
engine/collection/rpc/engine.go 0.00% 18 Missing ⚠️

📢 Thoughts on this report? Let us know!

Co-Authored-By: peter.argue@flowfoundation.org <peter.argue@flowfoundation.org>
Comment on lines 121 to 122
e.log.Err(err).Msg("failed to start server")
ctx.Throw(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
e.log.Err(err).Msg("failed to start server")
ctx.Throw(err)
ctx.Throw(fmt.Errorf("failed to start server: %w", err))

Comment on lines 128 to 129
e.log.Error().Err(err).Msg("fatal error in server")
ctx.Throw(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
e.log.Error().Err(err).Msg("fatal error in server")
ctx.Throw(err)
ctx.Throw(fmt.Errorf("error encountered while running grpc server: %w", err))

Co-Authored-By: peter.argue@flowfoundation.org <peter.argue@flowfoundation.org>
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