Skip to content

Conversation

@AleksandrKosovS
Copy link
Contributor

@AleksandrKosovS AleksandrKosovS commented Feb 6, 2025

Add exit_on_error description.

Schema: https://raw.githubusercontent.com/roadrunner-server/server/refs/heads/master/schema.json

Summary by CodeRabbit

  • New Features
    • Introduced an option that allows the server to terminate if an initialization command fails, enhancing error handling.
  • Documentation
    • Updated documentation to explain the new error handling behavior, clarifying how the server reacts when an initialization command fails.

Add exit_on_error description
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2025

Walkthrough

This pull request adds a new configuration option, exit_on_error, under the on_init section of the RoadRunner server plugin configuration. The option defaults to false and determines whether the server should terminate if the initialization command fails. The documentation has been updated to note that setting exit_on_error to true will halt the server on failure, contrasting with the previous behavior of logging the error and continuing operation.

Changes

File Change Summary
plugins/server.md Introduced exit_on_error in the on_init configuration (default: false) and updated docs.

Sequence Diagram(s)

sequenceDiagram
    participant Server
    participant InitCmd
    participant Logger/Handler
    Server->>InitCmd: Execute on_init command
    InitCmd-->>Server: Return result (success/failure)
    alt on_init success
        Server->>Server: Continue startup
    else on_init failure
        alt exit_on_error true
            Server->>Logger/Handler: Terminate server
        else exit_on_error false
            Server->>Logger/Handler: Log error and continue
        end
    end
Loading

Poem

In my burrow, I discovered a new feat,
exit_on_error making our init process neat.
When errors arise on the startup track,
The server may halt or simply log and come back.
Hopping with joy, CodeRabbit celebrates this tweak! 🐇🔧

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
plugins/server.md (1)

88-90: Clarify Behavior Override in the Hint Block

The hint block now instructs users with the statement:
“Use on_init.exit_on_error: true to stop RoadRunner if on_init command fails.”

To further improve clarity, consider explicitly stating that this setting overrides the default behavior (i.e., logging the error and continuing execution) when the on_init command fails. This additional clarification will help prevent any confusion regarding the server's behavior when this option is enabled.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1877326 and e4eee98.

📒 Files selected for processing (1)
  • plugins/server.md (2 hunks)
🔇 Additional comments (1)
plugins/server.md (1)

40-42: Document the New exit_on_error Option Clearly

The addition of the exit_on_error configuration option under the on_init section is well documented with a default value of false. This makes it clear to users that they need to opt in (by setting it to true) if they want RoadRunner to terminate on an initialization failure.

Copy link
Member

@rustatian rustatian left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @AleksandrKosovS 👍🏻

@rustatian rustatian merged commit b5c2737 into roadrunner-server:master Feb 6, 2025
1 check passed
@AleksandrKosovS AleksandrKosovS deleted the patch-1 branch February 7, 2025 13:38
@coderabbitai coderabbitai bot mentioned this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants