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

refactor: abstract gRPC server #156

Merged
merged 6 commits into from
Nov 8, 2024
Merged

refactor: abstract gRPC server #156

merged 6 commits into from
Nov 8, 2024

Conversation

KeranYang
Copy link
Member

@KeranYang KeranYang commented Nov 7, 2024

Closes #154

Tested by building test images and running the following pipeline for one hour with no issue. 2000 TPS.

apiVersion: numaflow.numaproj.io/v1alpha1
kind: Pipeline
metadata:
  name: all-healthy-pipeline
spec:
  vertices:
    - name: in
      source:
        udsource:
          container:
            image: quay.io/numaio/numaflow-java/source-simple-source:keran-test-refactor
            imagePullPolicy: Always
        transformer:
          container:
            image: quay.io/numaio/numaflow-java/mapt-event-time-filter-function:keran-test-refactor
            imagePullPolicy: Always
      scale:
        min: 1
    - name: cat       
      scale:
        min: 1
      udf:
        container:
          image: quay.io/numaio/numaflow-java/map-forward-message:keran-test-refactor
          imagePullPolicy: Always
    - name: sink
      scale:
        min: 1
      sink:
        udsink:
          container:
            image: quay.io/numaio/numaflow-java/simple-sink:keran-test-refactor
            imagePullPolicy: Always
  edges:
    - from: in
      to: cat
    - from: cat
      to: sink

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 65.26316% with 66 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@ea910b3). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...io/numaproj/numaflow/shared/GrpcServerWrapper.java 55.00% 15 Missing and 3 partials ⚠️
.../main/java/io/numaproj/numaflow/mapper/Server.java 64.70% 4 Missing and 2 partials ⚠️
...main/java/io/numaproj/numaflow/sourcer/Server.java 64.70% 4 Missing and 2 partials ⚠️
...io/numaproj/numaflow/sourcetransformer/Server.java 64.70% 4 Missing and 2 partials ⚠️
...va/io/numaproj/numaflow/reducestreamer/Server.java 64.28% 3 Missing and 2 partials ⚠️
...va/io/numaproj/numaflow/sessionreducer/Server.java 64.28% 3 Missing and 2 partials ⚠️
...in/java/io/numaproj/numaflow/sideinput/Server.java 64.28% 3 Missing and 2 partials ⚠️
...main/java/io/numaproj/numaflow/reducer/Server.java 66.66% 3 Missing and 1 partial ⚠️
.../java/io/numaproj/numaflow/mapstreamer/Server.java 80.00% 3 Missing ⚠️
.../java/io/numaproj/numaflow/batchmapper/Server.java 87.50% 2 Missing ⚠️
... and 3 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #156   +/-   ##
=======================================
  Coverage        ?   58.74%           
  Complexity      ?      384           
=======================================
  Files           ?      127           
  Lines           ?     2831           
  Branches        ?      179           
=======================================
  Hits            ?     1663           
  Misses          ?     1052           
  Partials        ?      116           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.
Signed-off-by: Keran Yang <[email protected]>
.
Signed-off-by: Keran Yang <[email protected]>
.
Signed-off-by: Keran Yang <[email protected]>
.
Signed-off-by: Keran Yang <[email protected]>
.
Signed-off-by: Keran Yang <[email protected]>
@KeranYang KeranYang marked this pull request as ready for review November 7, 2024 22:11
@KeranYang KeranYang changed the title (WIP) refactor: abstract gRPC server refactor: abstract gRPC server Nov 7, 2024
Server.this.stop();
log.info("gracefully shutting down event loop groups");
this.grpcServerHelper.gracefullyShutdownEventLoopGroups();
this.stop();
// FIXME - this is a workaround to immediately terminate the JVM process
// The correct way to do this is to stop all the actors and wait for them to terminate
System.exit(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Anyway to get rid of hard exit?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, @RohanAshar . Yes, I plan to fix it very soon. I was not able to fix it this week so I decided to create an issue and fix it ASAP next week.

Copy link
Contributor

@RohanAshar RohanAshar left a comment

Choose a reason for hiding this comment

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

LGTM

@KeranYang KeranYang merged commit 8241fdf into main Nov 8, 2024
5 checks passed
@KeranYang KeranYang deleted the abstract branch November 8, 2024 21:58
KeranYang added a commit to KeranYang/numaflow-java that referenced this pull request Jan 22, 2025
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.

abstract gRPC server creation and shutdown
2 participants