发布

  • [OPIK-4380] [BE] Fix dataset deadlock issue by wrapping version creation in reactive retry (#5364)

    frostbyte_neo 发布于 2026-02-23 15:04:44 +00:00

    Wrap all versionService.createVersionFromDelta() calls inside a canonical
    private createVersionFromDelta() helper that uses Mono.fromCallable() +
    retryWhen(RetryUtils.handleOnDeadLocks()) + subscribeOn(Schedulers.boundedElastic()).

    This ensures MySQL deadlock exceptions are caught and retried with exponential
    backoff (up to 5 attempts, 250ms base, 2s max, 0.5 jitter) instead of
    propagating to the caller and causing request failures.

    Also adds RetryUtils.handleOnDeadLocks() — a reusable RetryBackoffSpec
    that matches MySQLTransactionRollbackException with "Deadlock found" in the
    message (checked recursively through causes).

    Implements OPIK-4380: fix dataset dead lock issue

    下载附件