Skip to content

feat: integrate optional FlatBuffers RPC support with regression tests - #45

Open
Spicy-cream wants to merge 13 commits into
LinQuickDev:feature/flatbuffers-rpc-testsfrom
Spicy-cream:feature/flatbuffers-rpc-tests
Open

Spicy-cream wants to merge 13 commits into
LinQuickDev:feature/flatbuffers-rpc-testsfrom
Spicy-cream:feature/flatbuffers-rpc-tests

Conversation

@Spicy-cream

@Spicy-cream Spicy-cream commented Sep 10, 2026

Copy link
Copy Markdown

What problem does this PR solve?

Issue Number: N/A

Problem Summary:

bRPC does not currently provide integrated FlatBuffers RPC support. Applications
cannot directly use FlatBuffers messages through the bRPC Channel and Server
APIs, and there is no regression coverage for message ownership, malformed
buffers, or request rejection.

This PR adds optional FlatBuffers RPC support. The feature is disabled by
default, so existing builds do not acquire a mandatory FlatBuffers dependency.

What is changed and the side effects?

Changed:

  • Added an IOBuf-backed FlatBuffers Message, MessageBuilder, and allocator.
  • Added the fb_rpc protocol and integrated it with Channel, Controller, Server,
    and protocol registration.
  • Added service and method descriptors for generated FlatBuffers RPC code.
  • Fixed ownership handling in message, builder, and allocator move operations.
  • Added request verification to the example server and response verification to
    the example client.
  • Added the WITH_FLATBUFFERS build option, disabled by default.
  • Added conditional CMake and Make support while keeping default Bazel builds
    independent of FlatBuffers.
  • Added six message ownership and validation tests.
  • Added three TCP RPC tests covering a valid round trip, malformed-request
    rejection, and a successful request after rejection.

Validation:

  • CMake builds passed with FlatBuffers enabled and disabled.
  • Make builds passed with FlatBuffers enabled and disabled.
  • The FlatBuffers example build and smoke tests passed.
  • Six FlatBuffers message tests passed.
  • Three FlatBuffers RPC tests passed.
  • AddressSanitizer validation passed.
  • All 25 Linux, macOS, CMake, Make, Bazel, GCC, Clang, ASan, and license CI
    checks passed.

Side effects:

  • Performance effects:

    • FlatBuffers support is disabled by default and has no expected runtime
      effect on existing builds.
    • When enabled, messages use SingleIOBuf-backed contiguous storage to avoid
      unnecessary message-buffer copies.
    • No measured end-to-end performance improvement is claimed by this PR.
  • Breaking backward compatibility:

    • No intended breaking changes.
    • Existing builds remain unchanged unless FlatBuffers is explicitly enabled.
    • New FlatBuffers-specific APIs and a new protocol type are added.

Check List:

  • The changes are compilable with FlatBuffers enabled.
  • The project remains compilable with FlatBuffers disabled.
  • Unit and RPC regression tests are included.
  • AddressSanitizer validation passes.
  • The changes follow the Contributor Covenant Code of Conduct.

@Spicy-cream
Spicy-cream changed the base branch from master to feature/flatbuffers-rpc-tests September 17, 2026 08:47
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.

1 participant