发布

  • [OPIK-3483] [FE][BE][Python BE] Add Cancel Execution button for Optimization Studio (#4613)

    frostbyte_neo 发布于 2026-01-05 15:24:04 +00:00

    • [OPIK-3483] [BE] Add cancellation support for Studio optimizations
    • Java: OptimizationService sets Redis cancellation signal when status updated to CANCELLED
    • Python: CancellationChecker polls Redis and kills subprocess on cancellation
    • Added unit tests for CancellationChecker
    • Revision 2: Add Cancel Execution button to frontend toolbar
    • Add useOptimizationUpdateMutation hook for updating optimization status
    • Add Cancel Execution button to CompareOptimizationsToolbar (visible when running)
    • Button styled with red/destructive colors
    • Handle cancellation gracefully in Python worker (no exception on cancel)
    • Add 'Execution cancelled by the user' message to logs
    • Fix KeyError when process is killed externally
    • Revision 3: Address baz-reviewer feedback
    • Add fallback error message when all error properties are undefined
    • Make success toast message configurable to avoid tight coupling
    • Move cancellation-specific message to the calling component
    • [OPIK-3708]: refactor the FE cancel button;

    • Revision 4: Improve CancellationChecker code quality

    • Use threading.Event for thread-safe was_cancelled property
    • Add cleanup_cancel_key() to remove Redis key after cancellation
    • Add context manager support (enter/exit)
    • Remove duplicate JobMessageParseError (import from studio module)
    • Add 7 new tests for the improvements (15 total)
    • Revision 5: Improve Java cancellation code quality
    • Add validation to reject cancellation of non-cancellable statuses
    • Extract signalCancellationIfNeeded() private method with Javadoc
    • Add 4 integration tests for cancellation flow
    • Revision 6: Use ClientErrorException with CONFLICT status for invalid cancellation
    • Replace IllegalStateException with ClientErrorException(Response.Status.CONFLICT)
    • Returns HTTP 409 instead of 500 for invalid cancellation attempts
    • Update test to expect 409 status code
    • update data for cancelled runs as well;

    • [OPIK-3708]: refactor the FE cancel button;

    • reset polling state for changed optimizationIds;

    • eslint;


    Co-authored-by: aadereiko aliaksandr@comet.com

    下载附件