Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrated code lifecycle: Implement a workaround for hanging build jobs #8919

Merged

Conversation

BBesrour
Copy link
Member

@BBesrour BBesrour commented Jun 29, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
  • I strictly followed the server coding and design guidelines.

Changes affecting Programming Exercises

  • High priority: I tested all changes and their related features with all corresponding user types on a test server configured with the integrated lifecycle setup (LocalVC and LocalCI).

Motivation and Context

Fix hanging build jobs due threadpool being full. Reason why buildagent is marked as available even though pool is full is still unknown

Steps for Testing

Server with ICL
Prerequisites:

  • 1 Student
  • 1 Programming Exercise
  1. Check if programming exercises work correctly

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.







Review Progress

Performance Review

  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Screenshots

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of build job processing by handling RejectedExecutionException. If an exception occurs, the job is now re-added to the queue, and local build agent information is updated.

@BBesrour BBesrour self-assigned this Jun 29, 2024
@github-actions github-actions bot added the server Pull requests that update Java code. (Added Automatically!) label Jun 29, 2024
@BBesrour BBesrour temporarily deployed to artemis-test3.artemis.cit.tum.de June 29, 2024 15:03 — with GitHub Actions Inactive
@krusche krusche changed the title Integrated code lifecycle: Fix hanging build jobs Integrated code lifecycle: Implement a workaround for hanging build jobs Jun 30, 2024
@BBesrour BBesrour marked this pull request as ready for review June 30, 2024 10:39
@BBesrour BBesrour requested a review from a team as a code owner June 30, 2024 10:39
Copy link

coderabbitai bot commented Jun 30, 2024

Walkthrough

The primary change in the SharedQueueProcessingService class involves introducing handling for RejectedExecutionException within the checkAvailabilityAndProcessNextBuild method. If this exception is encountered, the build job will be re-enqueued and local build agent information refreshed. Additionally, the changes include impporting RejectedExecutionException, adding logging, and updating debug statements to improve traceability.

Changes

File Path Change Summary
.../artemis/service/connectors/localci/buildagent/SharedQueueProcessingService.java Handle RejectedExecutionException by re-enqueuing build jobs and refreshing local build agent info.
Imported RejectedExecutionException.
Added logging and re-queuing logic for RejectedExecutionException in checkAvailabilityAndProcessNextBuild.
Updated debug log statements in the nodeIsAvailable method.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant SharedQueueProcessingService
    participant BuildQueue
    participant NodeManager

    Client->>SharedQueueProcessingService: Request to process next build
    SharedQueueProcessingService->>NodeManager: Check node availability
    NodeManager-->>SharedQueueProcessingService: Response with node status
    alt Node available
        SharedQueueProcessingService->>BuildQueue: Dequeue and process build job
    else Node not available
        SharedQueueProcessingService-->>BuildQueue: Re-queue build job
    end
    SharedQueueProcessingService-->>Client: Confirmation of queue update or processing
    alt RejectedExecutionException occurs
        BuildQueue->>SharedQueueProcessingService: Raises RejectedExecutionException
        SharedQueueProcessingService->>BuildQueue: Re-queues build job
        SharedQueueProcessingService->>NodeManager: Refresh build agent info
        SharedQueueProcessingService-->>Client: Notification of re-queue due to exception
    end
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jun 30, 2024
az108
az108 previously approved these changes Jun 30, 2024
Copy link
Contributor

@az108 az108 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on TS3, programming exercises work as expected

Jan-Thurner
Jan-Thurner previously approved these changes Jun 30, 2024
Copy link
Contributor

@Jan-Thurner Jan-Thurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on TS3, works as expected. Code also lgtm, but you might consider adding : to the additional error messages (see comments). However, I do not have a strong opinion on this.

@BBesrour BBesrour dismissed stale reviews from Jan-Thurner, az108, and coderabbitai[bot] via 7422bea June 30, 2024 23:47
@dmytropolityka dmytropolityka temporarily deployed to artemis-test5.artemis.cit.tum.de July 1, 2024 00:27 — with GitHub Actions Inactive
@BBesrour
Copy link
Member Author

BBesrour commented Jul 2, 2024

@EneaGore @undernagruzez Thanks for your review! However, TS5 doesn't use ICL. Please use TS1, 2, 3 or 4.

Copy link
Contributor

@az108 az108 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change LGTM, Reapproval

Copy link
Contributor

@EneaGore EneaGore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on TS1. Lgtm.

Copy link
Contributor

@Jan-Thurner Jan-Thurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM

Copy link
Contributor

@JohannesStoehr JohannesStoehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge server Pull requests that update Java code. (Added Automatically!)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants