From 7b23099d68a6d13fee33a51caba11bdd1e5eae75 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Mon, 19 Oct 2020 16:43:08 +0200 Subject: [PATCH 1/3] Use micro default client for connections to account service --- glauth/pkg/command/server.go | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/glauth/pkg/command/server.go b/glauth/pkg/command/server.go index f0f690b4928..6c15b2670f9 100644 --- a/glauth/pkg/command/server.go +++ b/glauth/pkg/command/server.go @@ -17,7 +17,6 @@ import ( glauthcfg "github.com/glauth/glauth/pkg/config" "github.com/micro/cli/v2" - "github.com/micro/go-micro/v2" "github.com/micro/go-micro/v2/client" "github.com/oklog/run" openzipkin "github.com/openzipkin/zipkin-go" @@ -192,11 +191,7 @@ func Server(cfg *config.Config) *cli.Command { } } - as, gs, err := getAccountsServices() - if err != nil { - return err - } - + as, gs := getAccountsServices() server, err := glauth.Server( glauth.AccountsService(as), glauth.GroupsService(gs), @@ -312,19 +307,7 @@ func Server(cfg *config.Config) *cli.Command { } // getAccountsServices returns an ocis-accounts service -func getAccountsServices() (accounts.AccountsService, accounts.GroupsService, error) { - service := micro.NewService() - - // parse command line flags - service.Init() - - err := service.Client().Init( - client.ContentType("application/json"), - ) - if err != nil { - return nil, nil, err - } - return accounts.NewAccountsService("com.owncloud.api.accounts", service.Client()), - accounts.NewGroupsService("com.owncloud.api.accounts", service.Client()), - nil +func getAccountsServices() (accounts.AccountsService, accounts.GroupsService) { + return accounts.NewAccountsService("com.owncloud.api.accounts", client.DefaultClient), + accounts.NewGroupsService("com.owncloud.api.accounts", client.DefaultClient) } From 271063ac39d13b1ae3bcca0a08bfae3634b63ef4 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Mon, 19 Oct 2020 16:46:49 +0200 Subject: [PATCH 2/3] Changelog --- changelog/unreleased/glauth-micro-client | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 changelog/unreleased/glauth-micro-client diff --git a/changelog/unreleased/glauth-micro-client b/changelog/unreleased/glauth-micro-client new file mode 100644 index 00000000000..be376b90026 --- /dev/null +++ b/changelog/unreleased/glauth-micro-client @@ -0,0 +1,7 @@ +Bugfix: Use micro default client + +Tags: glauth + +We found a file descriptor leak in the glauth connections to the accounts service. Fixed it by using the micro default client. + +https://github.com/owncloud/ocis/pull/718 From eb31510600d1559f6a016ae11d6a4bc1d6a74fe5 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Mon, 19 Oct 2020 16:19:48 +0000 Subject: [PATCH 3/3] Automated changelog update [skip ci] --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e133e159be..3ff91edd148 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Bugfix - Add missing env vars to docker compose: [#392](https://github.com/owncloud/ocis/pull/392) * Bugfix - Don't enforce empty external apps slice: [#473](https://github.com/owncloud/ocis/pull/473) * Bugfix - Fix button layout after phoenix update: [#625](https://github.com/owncloud/ocis/pull/625) +* Bugfix - Use micro default client: [#718](https://github.com/owncloud/ocis/pull/718) * Bugfix - Fix director selection in proxy: [#521](https://github.com/owncloud/ocis/pull/521) * Bugfix - Build docker images with alpine:latest instead of alpine:edge: [#416](https://github.com/owncloud/ocis/pull/416) * Change - Accounts UI shows message when no permissions: [#656](https://github.com/owncloud/ocis/pull/656) @@ -72,6 +73,15 @@ https://github.com/owncloud/ocis/pull/625 +* Bugfix - Use micro default client: [#718](https://github.com/owncloud/ocis/pull/718) + + Tags: glauth + + We found a file descriptor leak in the glauth connections to the accounts service. Fixed it by + using the micro default client. + + https://github.com/owncloud/ocis/pull/718 + * Bugfix - Fix director selection in proxy: [#521](https://github.com/owncloud/ocis/pull/521) Tags: proxy