Follow-up from PR #592 review (thanks @XiaoSeS).
PR #592 fixes the core correctness issue (label changes now reliably update the search index, even on the CallerRuns fallback, via REQUIRES_NEW). Two non-blocking robustness gaps were raised in review and are tracked here:
1. MDC lost across the async hop
LabelSearchSyncService.rebuildSkill / rebuildSkills run on skillhubEventExecutor. The request MDC context (trace/request id) is not propagated to the executor thread, so rebuild logs cannot be correlated with the originating request.
Suggested fix: configure an MDC-propagating TaskDecorator on skillhubEventExecutor in AsyncConfig.
2. Async rebuild failures are log-only, no retry / no metric
On failure the rebuild only logs:
log.error("Failed to rebuild search document for skill {}", skillId, ex);
There is no retry and no metric, so a search document can stay permanently stale after a transient failure with nobody noticing.
Suggested fix: add a counter metric for rebuild failures (and optionally a bounded retry / compensation path), so stale indexes are observable.
Scope
Robustness / observability only — no correctness impact. The index write itself is already correct after #592.
Follow-up from PR #592 review (thanks @XiaoSeS).
PR #592 fixes the core correctness issue (label changes now reliably update the search index, even on the CallerRuns fallback, via
REQUIRES_NEW). Two non-blocking robustness gaps were raised in review and are tracked here:1. MDC lost across the async hop
LabelSearchSyncService.rebuildSkill/rebuildSkillsrun onskillhubEventExecutor. The request MDC context (trace/request id) is not propagated to the executor thread, so rebuild logs cannot be correlated with the originating request.Suggested fix: configure an MDC-propagating
TaskDecoratoronskillhubEventExecutorinAsyncConfig.2. Async rebuild failures are log-only, no retry / no metric
On failure the rebuild only logs:
There is no retry and no metric, so a search document can stay permanently stale after a transient failure with nobody noticing.
Suggested fix: add a counter metric for rebuild failures (and optionally a bounded retry / compensation path), so stale indexes are observable.
Scope
Robustness / observability only — no correctness impact. The index write itself is already correct after #592.