Repository navigation
Refactor GrpcDeploymentService: unify instantiation, fix cleanup, move interceptors out of loop - #512
Merged
jmesnil merged 2 commits intoOct 14, 2026
Conversation
jmesnil
marked this pull request as ready for review
October 7, 2026 12:30
jmesnil
force-pushed
the
worktree-refactor-deployment-service
branch
from
October 8, 2026 07:49
36ec2be to
26d6ad7
Compare
…e interceptors out of loop - Move createInterceptors() before the service loop: interceptors are deployment-scoped, not service-scoped; instantiating them once per service was wasteful and semantically wrong. - Merge createServiceInstance/createInterceptorInstance and their reflection fallbacks into a single generic createInstance(Class<T>) method, eliminating ~50 lines of duplication. - Extract cleanup into unregister() + runSafely() helpers so that exceptions thrown during stop() or error recovery accumulate as suppressed exceptions rather than being silently dropped. - Fix @priority sentinel: unannotated interceptors were sorted with Integer.MAX_VALUE - 1; use Integer.MAX_VALUE so the sentinel is unambiguously "lowest priority". Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…failures - Replace catch (Exception e) + instanceof chain with catch (StartException | RuntimeException e) + throw e, using Java's precise rethrow so each exception type is raised as-is with no wrapping and no loss of suppressed exceptions. - Add LOGGER.failedToCleanupGrpcResources (WFLYGRPC-0013, WARN) to runSafely() so exceptions swallowed during stop() are visible in the server log rather than silently discarded. - Fix comment typo: 'service sof' -> 'services of'. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
jmesnil
force-pushed
the
worktree-refactor-deployment-service
branch
from
October 13, 2026 08:47
e56e496 to
867a866
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createInterceptors()before the service loop — interceptors are deployment-scoped, not service-scoped; creating them inside the loop was wasteful and semantically wrong.createServiceInstance,createInterceptorInstance,createViaReflection, andcreateInterceptorViaReflectionare collapsed into a single genericcreateInstance(Class<T>)method, removing ~50 lines of duplication.unregister()+runSafely()helpers — cleanup code shared betweenstart()error recovery andstop()is now in one place; exceptions thrown during cleanup accumulate as suppressed exceptions rather than being silently dropped.@Prioritysentinel — unannotated interceptors usedInteger.MAX_VALUE - 1; changed toInteger.MAX_VALUEso the sentinel is unambiguously "lowest priority".These are purely internal refactoring changes to
GrpcDeploymentService.java. No functional behaviour changes, no API changes, no other files touched.