skillhub/server/skillhub-search/src
shychee de033da537 fix(search): make index writes REQUIRES_NEW to survive async caller-runs fallback
The @Async rebuildSkill fix relied on a fresh thread giving a clean
transaction boundary. But skillhubEventExecutor uses CallerRunsPolicy:
under saturation the rejected task runs on the caller (request) thread,
back inside the afterCommit synchronization phase — the original failure
context where the @Transactional index write is silently dropped.

Mark SearchIndexService.index as REQUIRES_NEW so it always suspends any
lingering post-commit synchronization and commits in its own transaction,
independent of whether the async dispatch actually happened.

Add regression tests: detach removes the label keyword, and a synchronous
rebuild inside the afterCommit phase still persists the document (fails
without REQUIRES_NEW).

Signed-off-by: shychee <shychee96@gmail.com>
2026-07-22 18:54:38 +08:00
..
main/java/com/iflytek/skillhub/search fix(search): make index writes REQUIRES_NEW to survive async caller-runs fallback 2026-07-22 18:54:38 +08:00
test fix(cli): filter installable search before pagination 2026-06-17 11:35:16 +08:00