Skip to content

AAP-14329: Add configurable virtual thread executor to gRPC service framework - #154

Merged
Gg-harness merged 2 commits into
mainfrom
AAP-14329-virtual-threads-executor-type
Aug 14, 2026
Merged

AAP-14329: Add configurable virtual thread executor to gRPC service framework#154
Gg-harness merged 2 commits into
mainfrom
AAP-14329-virtual-threads-executor-type

Conversation

@Gg-harness

@Gg-harness Gg-harness commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds an optional Executor field to GrpcPlatformServerDefinition (defaults to null — gRPC uses its own default executor)
  • When provided, the executor is passed directly to ServerBuilder.executor()
  • Callers can opt into any executor type (virtual threads, custom pools, etc.) without framework changes

Motivation

EDS hits OOMKills at 500 RPS when AI SecRules are enabled because the bounded platform thread pool saturates during blocking gRPC fan-out. Virtual threads eliminate this bottleneck by decoupling concurrency from OS thread count — each blocking call yields its carrier thread instead of holding it.

This change lets EDS (and any future service) pass a virtual thread executor without the framework needing to know about VT specifics.

Changes

File Change
GrpcPlatformServerDefinition.java New builder field Executor executor (default null)
GrpcPlatformServiceContainer.java Wires provided executor into ServerBuilder when non-null

Rollback

Not setting the executor field (default) preserves existing behavior — gRPC uses its own internal executor. Zero change for any service that doesn't opt in.

Test plan

  • Existing tests pass (no behavioral change when executor is unset)
  • Downstream EDS integration validates VT executor end-to-end
  • Helm toggle (executorType: virtualplatform) provides instant rollback in production

@Gg-harness
Gg-harness requested a review from a team as a code owner August 14, 2026 11:02
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown

Test Results

32 tests  ±0   32 ✅ ±0   13s ⏱️ ±0s
 9 suites ±0    0 💤 ±0 
 9 files   ±0    0 ❌ ±0 

Results for commit 7f87ca5. ± Comparison against base commit b879491.

♻️ This comment has been updated with latest results.

@Builder.Default int maxRstPerMinute = 500;
@Builder.Default Duration maxConnectionAge = Duration.ZERO;
@Builder.Default Duration maxConnectionAgeGrace = Duration.ZERO;
@Builder.Default ExecutorType executorType = ExecutorType.PLATFORM;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Enum doesn't feel very extensible. Why not just take an executor, callers can opt in to whatever executor they want, virtual threads or otherwise.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I'll refactor to accept an optional Executor directly. My original thinking was to centralize the reflection boilerplate (needed because of our Java 11 source constraint) + JDK < 21 fallback so every service opting into VTs doesn't reimplement the same pattern. But an open Executor field is more flexible and the duplication is minimal. Will update.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Gg-harness
Gg-harness merged commit 762e165 into main Aug 14, 2026
4 checks passed
@Gg-harness
Gg-harness deleted the AAP-14329-virtual-threads-executor-type branch August 14, 2026 19:33
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