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

Make the CSub GetCollectEntries() RPC response streaming #1865

Merged
merged 5 commits into from Apr 29, 2024

Conversation

nchelluri
Copy link
Contributor

@nchelluri nchelluri commented Apr 24, 2024

Description of the PR

As I demonstrated in #661 (comment), with the current main it is possible to quickly gather enough pURLs or other CSub data sources that the gRPC response size for a GetCollectEntries() call grows too big and so the call will error out. We decided that until some sort of CSub data source pubsub system is implemented (that will likely be the long term solution we go with), we will make this call have a streaming response, and I have done that in this PR.

A couple of notes:

  1. I tested this by running the test from the linked comment. In main the GetCollectEntries() calls fails after < 60K pURLs are in the response. With this PR, I get to over 160K pURLs in the (now-streaming) response and things still look fine.
  2. For some reason the version of protoc-gen-go v1.28.1 I used here is less than the previously used version which was protoc-gen-go v1.31.0. I can't explain this; I followed the instructions on https://grpc.io/docs/languages/go/quickstart/

PR Checklist

  • All commits have a Developer Certificate of Origin (DCO) -- they are generated using -s flag to git commit.
  • All new changes are covered by tests
  • If GraphQL schema is changed, make generate has been run
  • If OpenAPI spec is changed, make generate has been run
  • If collectsub protobuf has been changed, make proto has been run
  • All CI checks are passing (tests and formatting)
  • All dependent PRs have already been merged

- The deps.dev API proto file was removed in a6c67d3

Signed-off-by: Narsimham Chelluri (Narsa) <narsa@kusari.dev>
- also fix typo in CollectSubscriberServiceClient name

Signed-off-by: Narsimham Chelluri (Narsa) <narsa@kusari.dev>
- In my testing the message size gets too big at ~55K pURLs.
- So I bumped message size up from 1K entries to 15K entries.
  This should allow plenty of room for large data source
  entries and also still result in far fewer roundtrips.

Signed-off-by: Narsimham Chelluri (Narsa) <narsa@kusari.dev>
@pxp928 pxp928 requested a review from lumjjb April 29, 2024 12:18
Copy link
Collaborator

@pxp928 pxp928 left a comment

Choose a reason for hiding this comment

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

Looks Good! Minor Comments

pkg/misc/slice/chunk.go Show resolved Hide resolved
pkg/misc/slice/chunk_test.go Show resolved Hide resolved
pkg/misc/slice/chunk.go Outdated Show resolved Hide resolved
Signed-off-by: Narsimham Chelluri (Narsa) <narsa@kusari.dev>
Signed-off-by: Narsimham Chelluri (Narsa) <narsa@kusari.dev>
@kodiakhq kodiakhq bot merged commit 6100427 into guacsec:main Apr 29, 2024
8 checks passed
@nchelluri nchelluri deleted the nchelluri/csub-datasources-trimming branch April 29, 2024 13:05
arorasoham9 pushed a commit to arorasoham9/guac that referenced this pull request May 17, 2024
* Fix Makefile proto target

- The deps.dev API proto file was removed in a6c67d3

Signed-off-by: Narsimham Chelluri (Narsa) <narsa@kusari.dev>

* Make GetCollectEntries() rpc have a streaming response

- also fix typo in CollectSubscriberServiceClient name

Signed-off-by: Narsimham Chelluri (Narsa) <narsa@kusari.dev>

* Bump up response message size

- In my testing the message size gets too big at ~55K pURLs.
- So I bumped message size up from 1K entries to 15K entries.
  This should allow plenty of room for large data source
  entries and also still result in far fewer roundtrips.

Signed-off-by: Narsimham Chelluri (Narsa) <narsa@kusari.dev>

* Add missing header comments

Signed-off-by: Narsimham Chelluri (Narsa) <narsa@kusari.dev>

* Make cb error more descriptive

Signed-off-by: Narsimham Chelluri (Narsa) <narsa@kusari.dev>

---------

Signed-off-by: Narsimham Chelluri (Narsa) <narsa@kusari.dev>
Signed-off-by: Soham Arora <arorasoham9@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants