Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client, server: implement configurable wire message size limits. #172

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Commits on Aug 21, 2024

  1. channel: reject oversized messages on the sender side.

    Reject oversized messages on the sender side, keeping the
    receiver side rejection intact. This should provide minimal
    low-level plumbing for clients to attempt application level
    corrective actions on the requestor side, if the high-level
    protocol is designed with this in mind.
    
    Co-authored-by: Alessio Cantillo <cantillo.trd@gmail.com>
    Co-authored-by: Qian Zhang <cosmoer@qq.com>
    Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
    3 people committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    de273bf View commit details
    Browse the repository at this point in the history
  2. channel_test: update oversize message test.

    Co-authored-by: Alessio Cantillo <cantillo.trd@gmail.com>
    Co-authored-by: Qian Zhang <cosmoer@qq.com>
    Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
    3 people committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    d8c00df View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2024

  1. channel: allow discovery of overflown message size.

    Use a dedicated, grpc Status-compatible error to wrap the
    unique grpc status code, the size of the rejected message
    and the maximum allowed size when a message is rejected
    due to size limitations by the sending side.
    
    Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
    klihub committed Aug 27, 2024
    Configuration menu
    Copy the full SHA
    b5cd6e4 View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2024

  1. server_test: add Serve()/Shutdown() race test.

    Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
    klihub committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    dd32dde View commit details
    Browse the repository at this point in the history
  2. server: fix Serve() vs. immediate Shutdown() race.

    Fix a race where an asynchronous server.Serve() invoked in a
    a goroutine races with an almost immediate server.Shutdown().
    If Shutdown() finishes its locked closing of listeners before
    Serve() gets around to add the new one, Serve will sit stuck
    forever in l.Accept(), unless the caller closes the listener
    in addition to Shutdown().
    
    This is probably almost impossible to trigger in real life,
    but some of the unit tests, which run the server and client
    in the same process, occasionally do trigger this. Then, if
    the test tries to verify a final ErrServerClosed error from
    Serve() after Shutdown() it gets stuck forever.
    
    Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
    klihub committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    525ddce View commit details
    Browse the repository at this point in the history
  3. client,server: configurable wire message size limits.

    Implement configurable limits for the maximum accepted message
    size of the wire protocol. The default limit can be overridden
    using the WithClientWireMessageLimit() option for clients and
    using the WithServerWireMessageLimit() option for servers. Add
    exported constants for the minimum, maximum and default limits.
    
    Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
    klihub committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    e1f03b3 View commit details
    Browse the repository at this point in the history
  4. {channel,server}_test: add tests for message limits.

    Adjust unit test to accomodate for altered internal interfaces.
    Add unit tests to exercise the new message size limit options.
    
    Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
    klihub committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    9e19b2d View commit details
    Browse the repository at this point in the history