Skip to content

[Controller] Add gRPC support for getJobStatus API#2424

Closed
pthirun wants to merge 1 commit intolinkedin:mainfrom
pthirun:controller-grpc-migration-job
Closed

[Controller] Add gRPC support for getJobStatus API#2424
pthirun wants to merge 1 commit intolinkedin:mainfrom
pthirun:controller-grpc-migration-job

Conversation

@pthirun
Copy link
Copy Markdown
Contributor

@pthirun pthirun commented Jan 28, 2026

Problem Statement

As part of the controller gRPC migration, the getJobStatus API needs to be available via gRPC while maintaining the existing HTTP endpoint during the migration period. This follows the same pattern established by other controller API migrations, where business logic is abstracted so both HTTP and gRPC can share the same implementation.

Solution

Added gRPC support for the getJobStatus API following the established migration pattern:

  1. Proto definitions (JobGrpcService.proto): Added getJobStatus RPC method with GetJobStatusGrpcRequest and GetJobStatusGrpcResponse messages, including support for UncompletedPartitionGrpc and UncompletedReplicaGrpc nested messages
  2. Request handler (JobRequestHandler.java): Added getJobStatus() method that validates parameters and calls admin.getOffLinePushStatus(), returning a gRPC response
  3. gRPC service implementation (JobGrpcServiceImpl.java): Added getJobStatus() override (no ACL check needed for job status queries, matching HTTP endpoint behavior)
  4. HTTP route update (JobRoutes.java): Updated to convert HTTP requests to gRPC format and delegate to the shared handler
  5. Route registration (AdminSparkServer.java): Updated to pass the request handler to the route

The implementation reuses the existing business logic in Admin.getOffLinePushStatus(), ensuring consistency between HTTP and gRPC endpoints.

Code changes

  • Added new code behind a config. If so list the config names and their default values in the PR description.
  • Introduced new log lines.
    • Confirmed if logs need to be rate limited to avoid excessive logging. (Info/Debug level logging only, consistent with other gRPC endpoints)

Concurrency-Specific Checks

Both reviewer and PR author to verify

  • Code has no race conditions or thread safety issues. (Stateless request handling, delegates to existing thread-safe Admin methods)
  • Proper synchronization mechanisms (e.g., synchronized, RWLock) are used where needed. (N/A - no shared mutable state)
  • No blocking calls inside critical sections that could lead to deadlocks or performance degradation. (N/A - no critical sections)
  • Verified thread-safe collections are used (e.g., ConcurrentHashMap, CopyOnWriteArrayList). (N/A - no collections introduced)
  • Validated proper exception handling in multi-threaded code to avoid silent thread termination. (Uses handleRequest() utility for consistent error handling)

How was this PR tested?

  • New unit tests added.
    • JobRequestHandlerTest: Tests for success, error, invalid input, missing parameters, and optional parameters
    • JobGrpcServiceImplTest: Tests for success, error response, invalid argument error, started status, and optional parameters
    • JobRoutesTest: Tests for success, error, started status, and gRPC-to-HTTP response mapping
  • New integration tests added.
    • TestControllerGrpcEndpoints.testGetJobStatusGrpcEndpoint: End-to-end test that creates a store, starts an empty push, and queries job status via gRPC
  • Modified or extended existing tests.
  • Code coverage verified.
    • Generated Jacoco coverage report: ./gradlew :services:venice-controller:test :services:venice-controller:jacocoTestReport
    • Verified coverage for all new methods
  • Verified backward compatibility (if applicable). (HTTP endpoint unchanged, gRPC is additive)

Does this PR introduce any user-facing or breaking changes?

  • No. You can skip the rest of this section.
  • Yes. Clearly explain the behavior change and its impact.

@pthirun
Copy link
Copy Markdown
Contributor Author

pthirun commented Jan 29, 2026

/rerun-ci

Add gRPC support for the getJobStatus endpoint while
maintaining backward compatibility with the existing HTTP endpoint.

Changes:
- Add getJobStatus RPC to JobGrpcService.proto
- Add handler method to JobRequestHandler
- Add gRPC service implementation
- Update HTTP route to convert requests to gRPC format
- Add comprehensive unit and integration tests
@pthirun pthirun force-pushed the controller-grpc-migration-job branch from 46555e5 to 0d85a24 Compare January 29, 2026 22:51
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 1, 2026

Hi there. This pull request has been inactive for 30 days. To keep our review queue healthy, we plan to close it in 7 days unless there is new activity. If you are still working on this, please push a commit, leave a comment, or convert it to draft to signal intent. Thank you for your time and contributions.

@github-actions github-actions Bot added the stale label Mar 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 9, 2026

Closing this pull request due to 37 days of inactivity. This is not a judgment on the value of the work. If you would like to continue, please reopen or open a new PR and we will be happy to take another look. Thank you again for contributing.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant