Skip to content

#2236 feat: add server-side retry configuration for remote database commands#2255

Merged
robfrank merged 2 commits intomainfrom
feature/2236-add-serverside-retry-remote
Jun 12, 2025
Merged

#2236 feat: add server-side retry configuration for remote database commands#2255
robfrank merged 2 commits intomainfrom
feature/2236-add-serverside-retry-remote

Conversation

@robfrank
Copy link
Collaborator

This pull request introduces improvements to the RemoteHttpComponent class, adds retry logic for HTTP commands, and updates test cases to accommodate the new configuration option. The most notable changes include the addition of a retries parameter, modifications to the httpCommand method, and updates to the test setup for retry configuration.

Enhancements to RemoteHttpComponent:

  • Added a retries field to the class, initialized from the ContextConfiguration to allow configurable retry attempts for HTTP commands. (network/src/main/java/com/arcadedb/remote/RemoteHttpComponent.java) [1] [2]
  • Updated the httpCommand method to include the retries parameter in the JSON request payload for better control over transaction retries. (network/src/main/java/com/arcadedb/remote/RemoteHttpComponent.java)

(network/src/main/java/com/arcadedb/remote/RemoteHttpComponent.java)

Test updates for retry configuration:

  • Modified the RemoteDatabaseJavaApiIT test to include a ContextConfiguration setup with the TX_RETRIES parameter, ensuring the retry logic is properly tested. (server/src/test/java/com/arcadedb/remote/RemoteDatabaseJavaApiIT.java)
  • Added a debug statement in HTTPGraphIT to log the response for troubleshooting purposes. (server/src/test/java/com/arcadedb/server/HTTPGraphIT.java)

Dependency adjustments:

  • Updated imports in RemoteDatabase and test files to reflect changes in used classes and packages. (network/src/main/java/com/arcadedb/remote/RemoteDatabase.java, server/src/test/java/com/arcadedb/remote/RemoteDatabaseJavaApiIT.java) [1] [2]

@robfrank robfrank requested a review from lvca June 12, 2025 13:25
@robfrank robfrank added the enhancement New feature or request label Jun 12, 2025
@robfrank robfrank added this to the 25.6.1 milestone Jun 12, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @robfrank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request adds the capability to configure the number of retries for remote HTTP database commands via a global configuration setting. The RemoteHttpComponent now reads this setting and includes it in the command request payload, providing the server with the client's desired retry count. Associated tests have been updated to demonstrate and verify this new configuration option.

Highlights

  • Configurable Retries: Introduced a retries field in RemoteHttpComponent to store the number of retry attempts for HTTP commands, initialized from the GlobalConfiguration.TX_RETRIES setting.
  • Retry Count in Payload: Modified the httpCommand method to include the configured retries value in the JSON request payload sent to the server, allowing the server-side to potentially utilize this information.
  • Test Updates: Updated RemoteDatabaseJavaApiIT to configure GlobalConfiguration.TX_RETRIES via ContextConfiguration when creating the RemoteDatabase instance, ensuring the new retry setting is tested.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configureGemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a server-side retry configuration for remote database commands. The client-side RemoteHttpComponent is updated to send a retries parameter in the JSON payload, and tests are modified to include this new configuration. The changes appear to correctly implement the described feature. The review includes suggestions to improve maintainability by using a constant for a JSON key and replacing a debug print statement with proper logging.

jsonRequest.put("language", language);
jsonRequest.put("command", payloadCommand);
jsonRequest.put("serializer", "record");
jsonRequest.put("retries", retries);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The JSON key "retries" is used here as a literal string. Consider defining this as a public static final String constant, for example, within this class or a shared constants class. This improves maintainability by centralizing the key definition, making it easier to update if needed and reducing the risk of typos if the key is used in multiple places (e.g., client and server-side parsing).

@codacy-production
Copy link

codacy-production bot commented Jun 12, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.05% 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (c6587f3) 72452 46158 63.71%
Head commit (254ce12) 72454 (+2) 46194 (+36) 63.76% (+0.05%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#2255) 2 2 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Copy link
Contributor

@lvca lvca left a comment

Choose a reason for hiding this comment

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

Perfect, just a debug leftover to remove

@robfrank robfrank requested a review from lvca June 12, 2025 15:25
@robfrank robfrank merged commit d094e57 into main Jun 12, 2025
14 of 16 checks passed
robfrank added a commit that referenced this pull request Jun 17, 2025
@robfrank robfrank deleted the feature/2236-add-serverside-retry-remote branch June 20, 2025 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants