Skip to content

Comments

#3318 upgrade to 2.3.22.Final + fix#3319

Merged
robfrank merged 4 commits intomainfrom
fix/3318-undertow-upgrade
Feb 3, 2026
Merged

#3318 upgrade to 2.3.22.Final + fix#3319
robfrank merged 4 commits intomainfrom
fix/3318-undertow-upgrade

Conversation

@robfrank
Copy link
Collaborator

@robfrank robfrank commented Feb 3, 2026

What does this PR do?

should fix #3318

@gemini-code-assist
Copy link
Contributor

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 resolves a critical issue where ArcadeDB's HTTP server, powered by Undertow, failed to process large request bodies after an upgrade to Undertow 2.3.21.Final or later. The problem stemmed from Undertow's enhanced security measures (CVE fixes) that introduced stricter default limits on request entity size. The solution involves explicitly configuring the maximum entity size within the Undertow server setup, making it configurable via a new global setting, and upgrading the Undertow dependency to the latest stable version, 2.3.22.Final. A dedicated regression test has been added to validate the fix.

Highlights

  • Undertow Upgrade: The Undertow library has been upgraded from version 2.3.20.Final to 2.3.22.Final to incorporate the latest fixes and improvements.
  • Large HTTP Content Fix: Addressed an issue where sending large HTTP request bodies (over 2MB) would result in "broken pipe" errors due to stricter MAX_ENTITY_SIZE enforcement in newer Undertow versions.
  • Configurable Max Entity Size: Introduced a new global configuration property, SERVER_HTTP_BODY_CONTENT_MAX_SIZE, allowing users to define the maximum allowed size for HTTP request bodies, defaulting to 100MB.
  • Regression Test: A new test case, PostCommandHandlerLargeContentTest, was added to specifically reproduce and verify the fix for handling large HTTP content, ensuring future regressions are caught.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • 3318-undertow-upgrade.md
  • engine/src/main/java/com/arcadedb/GlobalConfiguration.java
    • Introduced SERVER_HTTP_BODY_CONTENT_MAX_SIZE configuration property with a default of 100MB, allowing users to control the maximum HTTP request body size.
  • pom.xml
    • Updated the undertow-core.version property from 2.3.20.Final to 2.3.22.Final.
  • server/pom.xml
    • Updated the undertow-core.version property from 2.3.20.Final to 2.3.22.Final.
  • server/src/main/java/com/arcadedb/server/http/HttpServer.java
    • Modified the buildUndertowServer method to set UndertowOptions.MAX_ENTITY_SIZE using the newly introduced SERVER_HTTP_BODY_CONTENT_MAX_SIZE from GlobalConfiguration.
  • server/src/test/java/com/arcadedb/server/http/handler/PostCommandHandlerLargeContentTest.java
    • Added a new JUnit test to verify the handling of large HTTP POST requests (approx. 2.7MB) by creating a document with large content and asserting successful insertion and retrieval.
Activity
  • The author, robfrank, identified and investigated issue [HTTP] Large content via HTTP problem (Undertow 2.3.22.Final) #3318, which involved "broken pipe" errors when sending large HTTP content after an Undertow upgrade.
  • A detailed root cause analysis was performed, attributing the issue to stricter MAX_ENTITY_SIZE enforcement in Undertow versions 2.3.21.Final and later, following CVE fixes.
  • A solution plan was developed and executed, including adding a new configuration option, applying it to the Undertow server, and upgrading the Undertow dependency.
  • A new regression test was created to ensure the fix correctly handles large HTTP request bodies and prevents future regressions.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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 configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@robfrank robfrank added this to the 26.2.1 milestone Feb 3, 2026
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 effectively addresses the "broken pipe" issue with large HTTP request bodies by upgrading Undertow and correctly configuring MAX_ENTITY_SIZE. The changes are well-reasoned, and the inclusion of a detailed markdown file explaining the root cause analysis is excellent for future reference. The addition of a new configuration option provides flexibility, and the new regression test ensures the fix is robust and prevents future regressions. My review includes a couple of minor suggestions to improve the accuracy of links in the documentation file.

@claude
Copy link

claude bot commented Feb 3, 2026

Pull Request Review: Undertow 2.3.22.Final Upgrade and Large Content Fix

Overview

This PR successfully addresses issue #3318 by fixing the "broken pipe" error when sending large HTTP request bodies (>2MB) after upgrading to Undertow 2.3.22.Final. The root cause analysis is thorough and the solution is well-implemented.


✅ Strengths

1. Excellent Root Cause Analysis

The included documentation (3318-undertow-upgrade.md) provides exceptional detail:

  • Clear identification of the CVE fixes (CVE-2024-3884, CVE-2024-4027) that changed behavior
  • Evidence-based reasoning with version comparisons
  • Well-documented investigation process

2. Comprehensive Test Coverage

The new test PostCommandHandlerLargeContentTest is excellent:

  • Reproduces the exact issue scenario (~2.7MB payload)
  • Uses deterministic data generation for reproducibility
  • Tests both insert and query operations
  • Proper use of AssertJ assertions (assertThat) per project conventions
  • Good documentation and comments

3. Configuration Design

  • Sensible default of 100MB
  • Configurable via GlobalConfiguration
  • Supports unlimited size with -1
  • Follows existing patterns in the codebase

⚠️ Issues & Recommendations

🔴 CRITICAL: Potential Issue with -1 (Unlimited) Value

Location: server/src/main/java/com/arcadedb/server/http/HttpServer.java:193

The code directly passes the configuration value to Undertow:

final long maxEntitySize = configuration.getValueAsLong(GlobalConfiguration.SERVER_HTTP_BODY_CONTENT_MAX_SIZE);
builder.setServerOption(UndertowOptions.MAX_ENTITY_SIZE, maxEntitySize);

Problem: According to Undertow documentation, MAX_ENTITY_SIZE uses:

  • -1 or values ≤ 0 = unlimited
  • Positive values = size limit in bytes

However, the code doesn't validate or handle the -1 case explicitly. While this likely works correctly (Undertow handles -1), it should be tested or documented.

Recommendation:

final long maxEntitySize = configuration.getValueAsLong(GlobalConfiguration.SERVER_HTTP_BODY_CONTENT_MAX_SIZE);
// Undertow treats -1 or negative values as unlimited
builder.setServerOption(UndertowOptions.MAX_ENTITY_SIZE, maxEntitySize);

Or add a test case verifying that -1 works as expected.


🟡 MEDIUM: Documentation File Should Not Be Committed

Location: 3318-undertow-upgrade.md

Per CLAUDE.md guidelines:

  • NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.
  • do not commit on git, I will do it after a review

Recommendation: This investigation document is valuable but should probably be:

  1. Moved to the issue comments/PR description instead of being committed to the repository root
  2. Or moved to a docs/ folder if the project maintains such documentation
  3. The filename format (issue number prefix) suggests it's a temporary investigation file

🟡 MEDIUM: Memory Considerations

Location: server/src/test/java/com/arcadedb/server/http/handler/PostCommandHandlerLargeContentTest.java:61-67

The test allocates a 2MB byte array and creates a ~2.7MB base64 string, then includes it in the command string, which gets serialized again to JSON. This means:

  • Byte array: ~2 MB
  • Base64 string: ~2.7 MB
  • Command string: ~2.7 MB + overhead
  • JSON serialization: another copy

Total memory: ~8-10 MB per test run (multiple copies in memory)

While acceptable for a single test, consider:

  1. Is there a test cleanup or @AfterEach that drops the database to prevent disk space issues?
  2. For CI/CD environments, this is fine, but document the memory requirement if needed

Minor: The test doesn't explicitly verify the data round-trips correctly (just that a result exists). Consider adding:

final JSONObject queryResponse = executeCommand(0, "sql", "SELECT FROM doc");
final String retrievedData = // extract txt field from result
assertThat(retrievedData).isEqualTo(base64Data);

🟢 MINOR: Code Style Adherence

Location: PostCommandHandlerLargeContentTest.java:65-67, 118-121

Per CLAUDE.md:

if statements with only one child sub-statement don't require a curly brace open/close, keep it simple

The test uses curly braces consistently, which is fine. However, some single-statement blocks could be simplified:

// Current (line 118-121)
try (final DataOutputStream wr = new DataOutputStream(connection.getOutputStream())) {
  wr.write(data);
  wr.flush();
}

This is acceptable as-is since try-with-resources typically uses braces. No change needed, just noting for consistency.


🟢 MINOR: Test Method Ordering

Location: PostCommandHandlerLargeContentTest.java:123

connection.connect() is called after setting up the output stream. While this works, the typical pattern is:

connection.setDoOutput(true);
// ... set headers ...
// connection.connect() is implicit when getOutputStream() is called
try (final DataOutputStream wr = new DataOutputStream(connection.getOutputStream())) {
  // ...
}

Current code is fine, just a minor optimization note.


🔍 Security Review

DoS Protection

The 100MB default limit is reasonable and prevents memory exhaustion attacks. Good balance between usability and security.

No New Vulnerabilities

  • No SQL injection risks (using proper command API)
  • No authentication bypasses
  • Proper error handling without information leakage

⚠️ Consider Adding Validation

For production deployments, consider documenting:

  • Recommended maximum size based on available memory
  • Warning about setting unlimited (-1) in production
  • Relation to other memory limits (JVM heap, etc.)

🧪 Testing Recommendations

Add Test Cases:

  1. Boundary test: Exactly 100MB payload (default limit)
  2. Overflow test: 101MB payload (should fail gracefully with proper error)
  3. Unlimited test: Set config to -1, send >100MB payload (should succeed)
  4. Configuration test: Verify the setting can be changed via configuration

Example:

@Test
void testContentExceedsMaxSize() {
  // Generate 101MB payload
  // Verify appropriate error response (not broken pipe)
}

@Test  
void testUnlimitedSize() {
  // Temporarily set SERVER_HTTP_BODY_CONTENT_MAX_SIZE to -1
  // Send >100MB payload
  // Verify success
}

📋 Checklist Against CLAUDE.md Requirements

Requirement Status Notes
State verification approach Documented in investigation file
Write tests first (TDD) ⚠️ Tests written, but unclear if TDD was used
Code adheres to existing standards Follows patterns well
Run verification Not shown in PR (need confirmation tests pass)
Run affected tests Should run PostCommandHandlerDecodeTest and other HTTP handler tests
Reuse existing components Uses existing config system
No unnecessary dependencies No new dependencies
Use assertThat style Proper AssertJ usage
Compile before finishing Need confirmation
Remove System.out debug Uses LogManager appropriately

🎯 Required Actions Before Merge

Must Do:

  1. Run full test suite for HTTP handlers to ensure no regressions
  2. ⚠️ Decide on the .md file: Move to docs/ or remove from commit
  3. ⚠️ Add test for -1 unlimited case to verify it works correctly
  4. ⚠️ Add test for exceeding limit to verify proper error handling

Should Do:

  1. Consider adding boundary tests (exactly 100MB, 101MB)
  2. Document recommended production settings in configuration docs
  3. Add cleanup in test to drop database/documents after test

Nice to Have:

  1. Verify data round-trips correctly in test
  2. Add performance note if there are concerns about buffering large requests in memory

🎉 Conclusion

This is a well-researched and well-implemented fix for a real production issue. The investigation quality is exceptional. With the minor issues addressed (particularly testing the -1 case and handling the documentation file), this PR will be ready to merge.

Overall Score: 8.5/10

Great work on the root cause analysis and fix! 👏

@mergify
Copy link
Contributor

mergify bot commented Feb 3, 2026

🧪 CI Insights

Here's what we observed from your CI run for c2f7e3e.

🟢 All jobs passed!

But CI Insights is watching 👀

@claude
Copy link

claude bot commented Feb 3, 2026

Pull Request Review: Undertow 2.3.22.Final Upgrade & Large Content Fix

Summary

This PR addresses issue #3318 by fixing the "broken pipe" errors when sending large HTTP request bodies (>2MB) after upgrading to Undertow 2.3.22.Final. The root cause analysis is thorough and the solution is well-implemented.


✅ Strengths

1. Excellent Root Cause Analysis

  • The documentation in docs/3318-undertow-upgrade.md is exemplary - detailed investigation of Undertow version changes, CVE fixes, and why the issue occurred
  • Correctly identified that Undertow 2.3.21+ enforces stricter MAX_ENTITY_SIZE limits after CVE-2024-3884 fixes
  • Clear explanation of the problem and solution

2. Proper Test Coverage

  • Added PostCommandHandlerLargeContentTest that reproduces the exact issue scenario (~2.7MB payload)
  • Test follows existing patterns from PostCommandHandlerDecodeTest
  • Deterministic test data generation (good for reproducibility)
  • Test properly validates both insertion and querying of large content

3. Configurable Solution

  • Added SERVER_HTTP_BODY_CONTENT_MAX_SIZE to GlobalConfiguration
  • Sensible default: 100MB
  • Allows users to configure based on their needs
  • Supports -1 for unlimited (as documented)

4. Code Quality

  • Adheres to existing code style (no braces for single-statement if blocks)
  • Proper use of final keyword on variables
  • Uses AssertJ assertions (assertThat()) as per project conventions
  • No System.out debug statements left behind

⚠️ Issues & Concerns

1. CRITICAL: Potential Issue with -1 (Unlimited) Value

Location: server/src/main/java/com/arcadedb/server/http/HttpServer.java:190-193

final long maxEntitySize = configuration.getValueAsLong(GlobalConfiguration.SERVER_HTTP_BODY_CONTENT_MAX_SIZE);
final Undertow.Builder builder = Undertow.builder()
    .setServerOption(UndertowOptions.ENABLE_HTTP2, true)
    .setServerOption(UndertowOptions.MAX_ENTITY_SIZE, maxEntitySize)

Problem: When users set the configuration to -1 (unlimited), this passes -1L directly to Undertow's MAX_ENTITY_SIZE option. According to Undertow documentation, -1 typically means "unlimited" for many options, BUT this should be verified for MAX_ENTITY_SIZE specifically.

Recommendation: Add a check to handle the -1 case explicitly:

final long maxEntitySize = configuration.getValueAsLong(GlobalConfiguration.SERVER_HTTP_BODY_CONTENT_MAX_SIZE);
final Undertow.Builder builder = Undertow.builder()
    .setServerOption(UndertowOptions.ENABLE_HTTP2, true);

// Only set MAX_ENTITY_SIZE if not -1 (unlimited)
if (maxEntitySize > 0)
    builder.setServerOption(UndertowOptions.MAX_ENTITY_SIZE, maxEntitySize);

Or verify in Undertow source that -1 is correctly interpreted as unlimited.

2. Test Implementation: Potential Improvements

Location: server/src/test/java/com/arcadedb/server/http/handler/PostCommandHandlerLargeContentTest.java:97-150

Minor Issues:

a) Duplicate HTTP client code: The executeCommandViaHTTP method duplicates logic from BaseGraphServerTest.executeCommand. While the comment says "this ensures we're testing the actual HTTP layer", it's unclear why the parent method wouldn't also test the HTTP layer.

Recommendation: Consider using the parent's executeCommand method unless there's a specific reason it wouldn't catch the bug. If there is a reason, add a comment explaining why.

b) Test database name: The test uses getDatabaseName() which returns "graph" (from BaseGraphServerTest), but the test creates a "doc" type, not a graph type. This works but is semantically odd.

Recommendation: Minor - not a blocker, but consider using a more appropriate base class or document the reason.

c) Log statements in test: The test has several log statements:

logInfo("Generated test data: %d bytes...")
logInfo("Successfully inserted document...")

Recommendation: While helpful for debugging, consider whether these are necessary in the final version. If kept, they're fine - many ArcadeDB tests use logging.

3. Documentation File Placement

Location: docs/3318-undertow-upgrade.md

Issue: The PR also moves 3307-cypher-head-collect-null-results.md to the docs/ folder. While organizing docs is good, this file move is unrelated to issue #3318.

Recommendation: This is fine if docs organization was needed, but it's worth noting in the PR description that this is a cleanup action unrelated to the main fix.

4. Missing Test: Negative Case

Location: Test coverage

Issue: The test verifies that large content works when the fix is applied, but there's no test that verifies the configuration is properly enforced. For example:

  • What happens when content exceeds the configured limit?
  • Does the error handling work correctly?

Recommendation: Consider adding a test that:

  1. Sets a lower MAX_SIZE (e.g., 1MB)
  2. Attempts to send 2MB
  3. Verifies appropriate error response

This would ensure the Undertow configuration is actually being applied correctly.


🔍 Performance Considerations

Positive:

  • No performance regression: The fix only adds a configuration read at server startup (one-time cost)
  • Memory safety: 100MB default limit prevents potential DoS attacks via extremely large payloads
  • Configurable: Users can tune based on their needs

Neutral:

  • The test generates 2MB of pseudo-random data in memory, but this is only during testing

🔒 Security Considerations

Positive:

  • DoS Protection: The 100MB default limit protects against unbounded memory consumption
  • Addresses CVE fixes: Upgrading to 2.3.22.Final includes important security patches (CVE-2024-3884, CVE-2024-4027)
  • Configurable limits: Administrators can adjust based on security requirements

Recommendation:

  • Consider documenting the security implications of setting -1 (unlimited) in the configuration description. Users should understand this removes DoS protection.

Suggested improvement to GlobalConfiguration.java:439-441:

SERVER_HTTP_BODY_CONTENT_MAX_SIZE("arcadedb.server.httpBodyContentMaxSize", SCOPE.SERVER,
    "Maximum size in bytes for HTTP request body content. Set to -1 for unlimited size (WARNING: removes DoS protection). Default is 100MB",
    Long.class, 100L * 1024 * 1024), // 100MB DEFAULT

📋 Code Style & Best Practices

✅ Follows ArcadeDB conventions:

  • Uses existing code style (minimal braces)
  • Uses final keyword appropriately
  • AssertJ assertions in tests
  • No Claude attribution in source code (as per CLAUDE.md)
  • Proper Apache 2.0 license headers

✅ Follows TDD approach:

  • Test was written to reproduce the bug
  • Fix was implemented
  • Test verifies fix works

📝 Suggested Improvements

High Priority:

  1. Verify -1 handling for MAX_ENTITY_SIZE - Either add explicit handling or document that Undertow correctly interprets -1 as unlimited
  2. Add negative test case - Verify limit enforcement works

Medium Priority:

  1. Enhance security documentation - Warn about DoS risks when using -1
  2. Consider test refactoring - Reuse parent executeCommand if possible

Low Priority:

  1. Test logging - Review if all log statements are necessary

✅ Overall Assessment

This is a well-researched and well-implemented fix. The root cause analysis is excellent, the test coverage is good, and the solution is elegant and configurable.

Recommendation: Approve with minor changes

The only critical item to address is verifying the -1 (unlimited) handling. Everything else is minor improvements.


Testing Checklist

Before merging, please verify:

  • Test passes with default configuration (100MB limit)
  • Test passes with custom limit (e.g., 200MB)
  • Test passes with -1 (unlimited) - CRITICAL TO VERIFY
  • Compilation succeeds: mvn clean install
  • Related tests pass: mvn test -Dtest="*PostCommand*"
  • Integration tests pass (if applicable)

Great work on this fix! The detailed documentation will be valuable for future maintainers.

@codacy-production
Copy link

codacy-production bot commented Feb 3, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-8.88% 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (491b673) 100598 65519 65.13%
Head commit (c2f7e3e) 130166 (+29568) 73218 (+7699) 56.25% (-8.88%)

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 (#3319) 4 4 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

- Fix incorrect CVE-2024-4027 link (was pointing to CVE-2024-3884)
- Update Undertow docs link from 2.0.x to 2.3.x
- Add security warning about -1 (unlimited) removing DoS protection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@claude
Copy link

claude bot commented Feb 3, 2026

PR Review - Issue #3318: Undertow Upgrade to 2.3.22.Final

Summary

This PR successfully addresses issue #3318 by upgrading Undertow from 2.3.20.Final to 2.3.22.Final and adding proper configuration for handling large HTTP request bodies. The implementation is well-documented, properly tested, and follows the project's conventions.

✅ Strengths

1. Root Cause Analysis

  • Excellent documentation in docs/3318-undertow-upgrade.md explaining the issue
  • Correctly identified that CVE-2024-3884 and CVE-2024-4027 fixes in Undertow 2.3.21+ introduced stricter enforcement of MAX_ENTITY_SIZE
  • Clear explanation of why the upgrade caused "broken pipe" errors with large request bodies

2. Proper Configuration Design

  • Added SERVER_HTTP_BODY_CONTENT_MAX_SIZE to GlobalConfiguration with sensible defaults (100MB)
  • Made it configurable via arcadedb.server.httpBodyContentMaxSize property
  • Supports -1 for unlimited (with clear security warning in documentation)
  • Follows existing configuration patterns in the codebase

3. Test Coverage

  • Added regression test PostCommandHandlerLargeContentTest that:
    • Reproduces the exact issue scenario (~2.7MB payload)
    • Uses deterministic pseudo-random data for reproducibility
    • Properly extends BaseGraphServerTest following project patterns
    • Tests both insertion and retrieval of large content
    • Includes helpful logging for debugging

4. Code Quality

  • Follows existing code style (proper use of final, assertThat syntax)
  • Proper Apache 2.0 license headers
  • Good variable naming and code organization
  • No System.out debug statements left behind

5. Documentation

  • Comprehensive documentation file explaining the issue and solution
  • Clear commit messages
  • Proper co-authoring attribution

📋 Minor Observations

1. Security Warning Enhancement (Optional)

The configuration description has a good warning about -1 removing DoS protection. Consider if this needs additional runtime validation or logging when unlimited is set.

Current:

SERVER_HTTP_BODY_CONTENT_MAX_SIZE("arcadedb.server.httpBodyContentMaxSize", SCOPE.SERVER,
    "Maximum size in bytes for HTTP request body content. Set to -1 for unlimited size (WARNING: removes DoS protection). Default is 100MB",
    Long.class, 100L * 1024 * 1024)

Consideration: Should there be a warning logged at server startup if set to -1?

2. Test Method Duplication (Minor)

The test includes a custom executeCommandViaHTTP method that duplicates some logic from the base class. This is acceptable for testing the raw HTTP layer, but consider if it could leverage more of the existing test infrastructure.

3. Documentation File Location

The doc files were moved to docs/ directory, which is good organization. Verify this aligns with the project's documentation structure conventions.

4. CVE Link Correction

Good catch fixing the incorrect CVE-2024-4027 link (was pointing to CVE-2024-3884). The correct links are now:

🔍 Code Review Details

GlobalConfiguration.java

SERVER_HTTP_BODY_CONTENT_MAX_SIZE("arcadedb.server.httpBodyContentMaxSize", SCOPE.SERVER,
    "Maximum size in bytes for HTTP request body content. Set to -1 for unlimited size (WARNING: removes DoS protection). Default is 100MB",
    Long.class, 100L * 1024 * 1024), // 100MB DEFAULT

✅ Proper scope (SERVER)
✅ Clear description with security warning
✅ Sensible default (100MB is reasonable for most use cases)
✅ Follows naming convention

HttpServer.java (lines 190-193)

final long maxEntitySize = configuration.getValueAsLong(GlobalConfiguration.SERVER_HTTP_BODY_CONTENT_MAX_SIZE);
final Undertow.Builder builder = Undertow.builder()
    .setServerOption(UndertowOptions.ENABLE_HTTP2, true)
    .setServerOption(UndertowOptions.MAX_ENTITY_SIZE, maxEntitySize)

✅ Reads configuration correctly
✅ Applied to Undertow builder in the right place
✅ Simple, clean implementation

PostCommandHandlerLargeContentTest.java

✅ Proper license header
✅ Extends correct base class
✅ Good JavaDoc explaining the issue being tested
✅ Test name clearly describes what it tests
✅ Uses assertThat syntax (per CLAUDE.md guidelines)
✅ Deterministic test data generation
✅ Comprehensive testing (insert + query)
✅ Proper cleanup via base class

🛡️ Security Considerations

Positive

  • Default 100MB limit provides DoS protection
  • Configurable maximum allows customization for legitimate use cases
  • Warning about -1 (unlimited) in configuration description

Considerations

  • Ensure operators understand the security implications of setting -1
  • Consider if there should be a hard maximum even when configured (e.g., refuse values > 2GB)
  • Document recommended values for different deployment scenarios

⚡ Performance Considerations

✅ The MAX_ENTITY_SIZE setting is read once during server initialization, no runtime overhead
✅ 100MB default should handle most use cases without memory issues
✅ Test uses ~2.7MB which is realistic for the reported issue

🧪 Testing Assessment

Test Coverage: Excellent

  • Regression test added that reproduces the exact issue
  • Test will fail without the fix, passes with it
  • Proper verification of both write and read operations

Recommendation: The PR mentions "Run all the connected tests could be affected by the change" but doesn't show test results. Before merging, verify:

mvn test -Dtest="*PostCommand*" -Dtest="*Http*"

📝 Documentation Quality

Excellent: The docs/3318-undertow-upgrade.md file is thorough and provides:

  • Clear problem statement
  • Root cause analysis
  • Version timeline
  • Implementation details
  • Test results table
  • References to CVE advisories

✅ Compliance with CLAUDE.md Guidelines

  • ✅ TDD approach: Test written for the issue
  • ✅ Regression test included
  • ✅ Code follows existing style (final keyword, no unnecessary braces)
  • ✅ Uses assertThat syntax for tests
  • ✅ No System.out left in code
  • ✅ No Claude listed as author
  • ✅ Reuses existing components (BaseGraphServerTest)
  • ✅ No unnecessary dependencies added
  • ✅ Security considered (DoS protection)

🎯 Recommendation

APPROVE

This is a well-executed fix that:

  1. Correctly identifies and addresses the root cause
  2. Adds proper configuration with sensible defaults
  3. Includes comprehensive testing
  4. Provides excellent documentation
  5. Follows all project conventions

Pre-merge Checklist

  • Verify compilation: mvn clean compile
  • Run related tests: mvn test -Dtest="*PostCommand*"
  • Verify no other HTTP tests are broken
  • Consider adding server startup warning when max size is set to -1 (optional enhancement)

Great work on this fix! The attention to detail in documentation and testing is particularly commendable.


Review generated by Claude Code following ArcadeDB's CLAUDE.md guidelines

@robfrank robfrank merged commit fe208c3 into main Feb 3, 2026
7 checks passed
robfrank added a commit that referenced this pull request Feb 17, 2026
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.

[HTTP] Large content via HTTP problem (Undertow 2.3.22.Final)

1 participant