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

enhancement: introduce micro registry and client pool selectors #3939

Merged
merged 13 commits into from
Jun 7, 2023

Conversation

fschade
Copy link
Contributor

@fschade fschade commented Jun 6, 2023

Add the ability to use iterable client pools for the grpc service communication,
the underlying grpc client and connection is fetched randomly from the available services.

Todos:

  • update micro registry
  • changelog and description

@fschade fschade requested review from a team, labkode and ishank011 as code owners June 6, 2023 08:23
@fschade fschade marked this pull request as draft June 6, 2023 08:25
@fschade fschade force-pushed the client-selector-pool branch from b9a4571 to e275423 Compare June 6, 2023 13:44
@fschade fschade marked this pull request as ready for review June 6, 2023 13:50
@fschade fschade requested a review from glpatcern as a code owner June 6, 2023 13:50
@rhafer rhafer force-pushed the client-selector-pool branch from 402e9ed to 0f97a66 Compare June 7, 2023 07:29
@fschade fschade force-pushed the client-selector-pool branch from ada11ab to cdb4ada Compare June 7, 2023 08:49
fschade and others added 5 commits June 7, 2023 12:16
use selectors in sharesstorageprovider.go and let the selectors next fail if a service is unknown
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
conf *config
gateway gateway.GatewayAPIClient
conf *config
gatewaySelector pool.Selectable[gateway.GatewayAPIClient]
Copy link

Choose a reason for hiding this comment

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

expected ';', found '[' (and 10 more errors)

@@ -62,8 +62,8 @@ type config struct {
}

type service struct {
gateway gateway.GatewayAPIClient
sharesProviderClient collaboration.CollaborationAPIClient
gatewaySelector pool.Selectable[gateway.GatewayAPIClient]
Copy link

Choose a reason for hiding this comment

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

expected ';', found '[' (and 9 more errors)

@@ -271,7 +272,12 @@ func (h *DavHandler) Handler(s *svc) http.Handler {
})
}

func getTokenStatInfo(ctx context.Context, client gatewayv1beta1.GatewayAPIClient, token string) (*provider.StatResponse, error) {
func getTokenStatInfo(ctx context.Context, selector pool.Selectable[gatewayv1beta1.GatewayAPIClient], token string) (*provider.StatResponse, error) {
Copy link

Choose a reason for hiding this comment

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

missing ',' in parameter list (and 2 more errors)

@@ -159,14 +160,14 @@ type LockSystem interface {
}

// NewCS3LS returns a new CS3 based LockSystem.
func NewCS3LS(c gateway.GatewayAPIClient) LockSystem {
func NewCS3LS(s pool.Selectable[gateway.GatewayAPIClient]) LockSystem {
Copy link

Choose a reason for hiding this comment

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

missing ',' in parameter list (and 9 more errors)

@@ -144,7 +144,7 @@ type svc struct {
davHandler *DavHandler
favoritesManager favorite.Manager
client *http.Client
gwClient gateway.GatewayAPIClient
gatewaySelector pool.Selectable[gateway.GatewayAPIClient]
Copy link

Choose a reason for hiding this comment

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

expected ';', found '[' (and 5 more errors)

@@ -39,15 +40,15 @@ type Downloader interface {
}

type revaDownloader struct {
gtw gateway.GatewayAPIClient
httpClient *http.Client
gatewaySelector pool.Selectable[gateway.GatewayAPIClient]
Copy link

Choose a reason for hiding this comment

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

expected ';', found '[' (and 2 more errors)

@@ -46,12 +47,12 @@ type Walker interface {
}

type revaWalker struct {
gtw gateway.GatewayAPIClient
gatewaySelector pool.Selectable[gateway.GatewayAPIClient]
Copy link

Choose a reason for hiding this comment

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

expected ';', found '[' (and 2 more errors)

sharesProviderClient *cs3mocks.CollaborationAPIClient
s sprovider.ProviderAPIServer
gatewayClient *cs3mocks.GatewayAPIClient
gatewaySelector pool.Selectable[gateway.GatewayAPIClient]
Copy link

Choose a reason for hiding this comment

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

expected ';', found '[' (and 10 more errors)

walker walker.Walker
downloader downloader.Downloader
config *Config
gatewaySelector pool.Selectable[gateway.GatewayAPIClient]
Copy link

Choose a reason for hiding this comment

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

expected ';', found '[' (and 4 more errors)

sublog.Error().Err(err).Str("depth", cp.depth.String()).Msg("error executing path copy")
w.WriteHeader(http.StatusInternalServerError)
}
w.WriteHeader(cp.successCode)
}

func (s *svc) executePathCopy(ctx context.Context, client gateway.GatewayAPIClient, w http.ResponseWriter, r *http.Request, cp *copy) error {
func (s *svc) executePathCopy(ctx context.Context, selector pool.Selectable[gateway.GatewayAPIClient], w http.ResponseWriter, r *http.Request, cp *copy) error {
Copy link

Choose a reason for hiding this comment

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

missing ',' in parameter list (and 1 more errors)

@fschade fschade merged commit 5e00e2e into cs3org:edge Jun 7, 2023
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.

3 participants