allthingssecurity commented on PR #30527:
URL: https://github.com/apache/camel/pull/30527#issuecomment-7060142054
Thanks for the careful review.
1. Stop time with many groups: changed in 7e9e0d65c013.
- The wait for the running refresh and the release now share one renew
deadline per view (before, each had its own).
- The views that stop while the CamelContext or the cluster service stops
share one renew deadline in all. This includes the CamelContext stop, where
`ClusteredRoutePolicy` and `MasterConsumer` release their views before the
cluster service stops. Only the time the views spend in their own stop counts,
not the time between them (such as the graceful shutdown of the routes). A view
that comes after the time is used up does not try the release, so its lease is
kept until the pod is no longer ready, as before.
- A view also does not try the release when its last lookup or renewal of
the lease failed, as you suggested. With the default client settings a lookup
only fails after the client's own retries, so this mostly helps in a longer
outage; the shared deadline is what keeps the stop short.
- The upgrade guide says that the wait is per group for a view that stops
on its own while the CamelContext runs (such as when its last clustered route
is removed), and shared when the CamelContext or the cluster service stops.
- New tests, three groups led by one pod: with an API server that stops
answering, the stop of the cluster service, and the CamelContext stop with a
clustered route per group, stay under two renew deadlines (they took about
three on the first commit). After failed lookups the stop does not wait for the
API server. With a healthy API server and a long time between the route
shutdowns, every group still releases its lease.
2. Agreed, I will keep it for the follow-up together with
`FileLockClusterView`.
3. Done in the same commit: debug log, re-interrupt, return. The state stays
LOSING_LEADERSHIP, which `releaseLeadership` accepts.
4. Yes, it does affect that test. Without `setRefuseRequests(true)` the test
still passes: the restarted view gets the same client, which the stop closed,
so its lookups fail anyway (requests on a closed client fail with
`IllegalStateException: Client is closed`). So the closed client is what makes
them fail, not the refused requests. The test still checks what it says (no
stale leadership while the lookups fail), but for that other reason. The same
close also matters with several groups and a client set on the configuration:
the first view that stops closes the client of the others (the rebalancing
tests log "Client is closed" on their releases). The new tests use a client per
view for that reason. I have not filed a JIRA; we can file one if you agree.
Tests: module tests 217 run, 0 failures; `KubernetesClusterViewStopTest` 21
times in one JVM, 378 run, 0 failures. The PR description is updated.
_Claude Code on behalf of allthingssecurity_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]