skillhub/server/skillhub-search
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
..
src fix(search): make index writes REQUIRES_NEW to survive async caller-runs fallback 2026-07-22 18:54:38 +08:00
pom.xml chore(release): v0.1.0 2026-03-19 20:25:18 +08:00