yangjj-iso commented on PR #7843:
URL: https://github.com/apache/shenyu/pull/7843#issuecomment-6260795585

   @Aias00 Thanks for the careful review. All four notes are addressed in 
569f28c:
   
   1. **Single-threaded rebuilds** — added 
`shenyu.sync.http.cache-rebuild-threads` (default `1`, range 1–64). Each key 
still owns at most one scheduled or running drain, so distinct namespace/group 
keys rebuild in parallel while one key never rebuilds concurrently; groups in 
the same namespace still serialize on that namespace's lock, as today. The doc 
now has a "Worker threads trade-off" section describing the serialization cost 
of the default. New tests: `multipleWorkersRebuildDistinctKeysInParallel` (a 
barrier that only completes if two keys run concurrently) and 
`multipleWorkersNeverRebuildTheSameKeyConcurrently` (200 concurrent requests on 
4 workers, max one in-flight rebuild, newest value published).
   2. **`notifyChanged`** — commented: the coalesced rebuild owns the 
`DataChangeTask` after publication, so notifying from the callback would wake 
clients before the cache changes.
   3. **`request` after close** — now returns `false`, so a commit racing 
`destroy()` rebuilds synchronously instead of failing its after-commit hook; 
the coalesced notification is skipped (debug log) only when the notification 
scheduler is already shut down. Covered by 
`commitRacingShutdownRebuildsSynchronouslyWithoutFailingTheCommit`.
   4. **Unbounded retry** — exponential backoff 1s → 2s → … capped at 30s 
(never below the window), reset after a successful rebuild. I kept "never give 
up" deliberately: dropping the key would leave long-poll readers on a stale 
snapshot, and the cap bounds a permanently failing key to one error log per 
30s. Covered by 
`consecutiveFailuresBackOffExponentiallyUpToTheCapAndResetAfterSuccess` and 
`retryDelayNeverOverflowsAndNeverUndercutsTheWindow`.
   
   Verification on current master `eb0c32ff7` (which includes #7846): 105 
targeted tests and the full `shenyu-admin` suite (2070 tests) pass; Checkstyle 
and admin RAT pass. The recorded benchmark ran with the default single worker 
and no failures, so these changes do not alter its measured paths.
   


-- 
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]

Reply via email to