Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository:hexlet-codebattle/codebattle
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base:master
Choose a base ref
...
head repository:hexlet-codebattle/codebattle
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare:feature/async-code-execution
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 5 files changed
  • 1 contributor

Commits on May 21, 2025

  1. Refactor: Implement asynchronous code execution and improve runner ro…

    …bustness This commit introduces several significant changes to address potential bottlenecks and improve system robustness: 1. **Asynchronous Code Execution:** * The primary change is the refactoring of the code checking process from a synchronous to an asynchronous model. * `Codebattle.CodeCheck.Checker` now uses a new `Codebattle.CheckerTaskSupervisor` to run individual code checks in non-blocking asynchronous tasks. * `Codebattle.Game.Engine.check_result/2` now initiates these asynchronous checks and returns immediately. * `Codebattle.Game.Server` (the GenServer for each game) receives the results of these checks via messages in new `handle_info` clauses and then proceeds with game logic (updating state, broadcasting events, storing results). * This change significantly reduces blocking in the game engine, improving responsiveness and throughput, especially under load. **IMPORTANT**: The return signature of `Codebattle.Game.Engine.check_result/2` has changed. It no longer returns the direct result of the check. Frontend components relying on this direct result must be updated to listen for Phoenix channel events that signal the outcome of the code submission. 2. **Runner Temporary File Cleanup:** * The `Runner.Executor` has been updated to make temporary file cleanup more robust. * Deletion attempts now include error logging and a retry mechanism to prevent disk space exhaustion from failed cleanups. 3. **Investigations:** * `Runner.StateContainersRunLimiter` was investigated. While it's a centralized resource manager, no immediate changes were deemed necessary. It can be a subject for future optimization if it becomes a clear bottleneck. * Potential issues with large output handling in `Runner.Executor` were noted but deferred, as there's no current evidence of this being an active problem. These changes aim to make the platform more scalable and resilient. Further testing, especially integration and load testing, is recommended to fully validate the impact of these modifications.
    @google-labs-jules
    google-labs-jules[bot] committed May 21, 2025
    Configuration menu
    Copy the full SHA
    e04f90fView commit details
    Browse the repository at this point in the history
Loading