Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions scheduler/cmd/pipelinegateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ const (
serviceTag = "seldon-pipelinegateway"
)

const (
waitForRouteToBeRemovedFromEnvoy = 1 * time.Second
Copy link
Member

Choose a reason for hiding this comment

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

This might not be enough with multiple envoy replicas, but it's a good point to start from. Did you by any chance run with multiple envoy replicas already?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me test that scenario, only tested with 1

)

var (
httpPort int
grpcPort int
Expand Down Expand Up @@ -255,13 +259,16 @@ func main() {

waitForTermSignalOrErr(logger, errChan)

logger.Infof("Shutting down scheduler client")
// TODO this should probably be a synchronous call to signal to the scheduler to remove gw from envoy cluster,
// so we can have more confidence reqs are no longer incoming
schedulerClient.Stop()
time.Sleep(waitForRouteToBeRemovedFromEnvoy)
logger.Infof("Shutting down http server")
if err := httpServer.Stop(); err != nil {
logger.WithError(err).Error("Failed to stop http server")
}
logger.Infof("Shutting down scheduler client")
grpcServer.Stop()
schedulerClient.Stop()
}

func waitForTermSignalOrErr(logger *log.Logger, errChan <-chan error) {
Expand Down
Loading