Skip to content

Optimize build: Fix parallel build issues with port conflicts and implicit dependencies#420

Merged
jiang95-dev merged 1 commit intolinkedin:mainfrom
cbb330:fix-parallel-build-issues
Jan 15, 2026
Merged

Optimize build: Fix parallel build issues with port conflicts and implicit dependencies#420
jiang95-dev merged 1 commit intolinkedin:mainfrom
cbb330:fix-parallel-build-issues

Conversation

@cbb330
Copy link
Collaborator

@cbb330 cbb330 commented Dec 31, 2025

Summary

Fix port conflicts in OpenAPI spec generation to enable parallel builds, reducing build time by 50%.

Previously, all three services (tables, housetables, jobs) would start Spring Boot on the same default port (8080) during OpenAPI spec generation. In parallel builds, this caused port conflicts and incorrect API specs, leading to compilation failures.

Build time improvement (./gradlew clean build -x test --parallel):

Time
Before BUILD FAILED (port conflicts)
After 156s (2m 35s)
vs Sequential 314s → 156s (-50% faster)

Changes

  • Client-facing API Changes
  • Internal API Changes
  • Bug Fixes
  • New Features
  • Performance Improvements
  • Code Style
  • Refactoring
  • Documentation
  • Tests

Bug Fix & Performance Improvements

  • Configured unique ports for each service's OpenAPI spec generation:
    • Tables service: port 8000
    • HouseTables service: port 8001
    • Jobs service: port 8002
  • Added explicit dependsOn configurations.runtimeClasspath to dummytokens:jar task to fix implicit dependency warning

Before (parallel build fails):

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
* What went wrong:
Execution failed for task ':integrations:java:iceberg-1.2:openhouse-java-runtime:compileJava'.
> Compilation failed; see the compiler error output for details.

2: Task failed with an exception.
* What went wrong:
Execution failed for task ':integrations:java:iceberg-1.5:openhouse-java-iceberg-1.5-runtime:compileJava'.
> Compilation failed; see the compiler error output for details.

BUILD FAILED in 1m 10s

After (parallel build succeeds):

> Task :services:tables:generateOpenApiDocs
> Task :services:housetables:generateOpenApiDocs
> Task :services:jobs:generateOpenApiDocs

BUILD SUCCESSFUL in 2m 35s
254 actionable tasks: 244 executed, 10 up-to-date

Testing Done

  • Manually Tested on local docker setup. Please include commands ran, and their output.
  • Added new tests for the changes made.
  • Updated existing tests to reflect the changes made.
  • No tests added or updated. Please explain why. If unsure, please feel free to ask for help.
  • Some other form of testing like staging or soak time in production. Please explain.

Manual Testing

  1. Verified parallel build fails on main branch due to port conflicts
  2. Verified parallel build succeeds with fixes applied
  3. Verified generated OpenAPI specs are correct (tables.json contains Tables API endpoints)
  4. Measured before/after build times with ./gradlew clean build -x test --parallel

No Tests Added

This is a build infrastructure change that doesn't affect runtime behavior. The fix is validated by the parallel build completing successfully.

Additional Information

  • Breaking Changes
  • Deprecations
  • Large PR broken into smaller PRs, and PR plan linked in the description.

🤖 Generated with Claude Code

Configure unique ports for each service's OpenAPI spec generation:
- Tables service: port 8000
- HouseTables service: port 8001
- Jobs service: port 8002

Also fix implicit dependency in dummytokens:jar task.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@cbb330 cbb330 changed the title Fix parallel build issues with port conflicts and implicit dependencies Optimize build: Fix parallel build issues with port conflicts and implicit dependencies Jan 1, 2026
@jiang95-dev jiang95-dev merged commit 1feddec into linkedin:main Jan 15, 2026
1 check passed
jiang95-dev pushed a commit that referenced this pull request Jan 18, 2026
…warnings (#421)

## Summary

Enable parallel build by default so users don't need to pass
`--parallel` flag.

This PR adds `org.gradle.parallel=true` to gradle.properties. It also
fixes Gradle deprecation warnings related to `mainClassName` and
`JavaExec.main`.

> **Note:** This PR builds on #420 (port conflict fixes) and should be
merged after it.

**Build time improvement** (`./gradlew clean build -x test`):
same existing improvement from
#420

## Changes

- [ ] Client-facing API Changes
- [ ] Internal API Changes
- [ ] Bug Fixes
- [ ] New Features
- [x] Performance Improvements
- [ ] Code Style
- [x] Refactoring
- [ ] Documentation
- [ ] Tests

### Performance Improvements
- Added `org.gradle.parallel=true` to `gradle.properties` to enable
parallel builds by default
- Users no longer need to remember to pass `--parallel` flag

### Refactoring (Deprecation Fixes)
- Fixed deprecated `mainClassName` in
`scripts/java/tools/dummytokens/build.gradle` → use `application {
mainClass = ... }`
- Fixed deprecated `JavaExec.main` in
`integrations/spark/spark-3.1/openhouse-spark-runtime/build.gradle` →
use `mainClass`

**Before** (deprecation warnings):
```
The JavaExec.main property has been deprecated. This is scheduled to be removed in Gradle 8.0.
Please use the mainClass property instead.
```

**After** (no warnings):
```
BUILD SUCCESSFUL in 2m 35s
254 actionable tasks: 244 executed, 10 up-to-date
```

## Testing Done

- [x] Manually Tested on local docker setup. Please include commands
ran, and their output.
- [ ] Added new tests for the changes made.
- [ ] Updated existing tests to reflect the changes made.
- [x] No tests added or updated. Please explain why. If unsure, please
feel free to ask for help.
- [ ] Some other form of testing like staging or soak time in
production. Please explain.

### Manual Testing
1. Verified build runs in parallel by default (no `--parallel` flag
needed)
2. Verified deprecation warnings are fixed with `--warning-mode all`
3. Measured before/after build times

### No Tests Added
This is a build infrastructure change that doesn't affect runtime
behavior.

# Additional Information

- [ ] Breaking Changes
- [ ] Deprecations
- [ ] Large PR broken into smaller PRs, and PR plan linked in the
description.

**Dependencies:** Merge #420 first (port conflict fixes required for
parallel builds to work correctly)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.5 <[email protected]>
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