Skip to content

Commit

Permalink
fix 820 - race condition
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic committed Nov 10, 2020
1 parent f459a43 commit 6c9005e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions accounts/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ func Server(cfg *config.Config) *cli.Command {

gr.Add(func() error {
logger.Info().Str("service", server.Name()).Msg("Reporting settings bundles to settings service")
go svc.RegisterSettingsBundles(&logger)
go svc.RegisterPermissions(&logger)
svc.RegisterSettingsBundles(&logger)
svc.RegisterPermissions(&logger)
return server.Run()
}, func(_ error) {
logger.Info().
Expand Down
4 changes: 2 additions & 2 deletions accounts/pkg/service/v0/permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ func RegisterPermissions(l *olog.Logger) {
res, err := service.AddSettingToBundle(context.Background(), &permissionRequests[i])
bundleID := permissionRequests[i].BundleId
if err != nil {
l.Err(err).Str("bundle", bundleID).Str("setting", permissionRequests[i].Setting.Id).Msg("error adding setting to bundle")
l.Err(err).Str("bundle", bundleID).Str("setting", permissionRequests[i].Setting.Id).Msg("error adding permission to bundle")
} else {
l.Info().Str("bundle", bundleID).Str("setting", res.Setting.Id).Msg("successfully added setting to bundle")
l.Info().Str("bundle", bundleID).Str("setting", res.Setting.Id).Msg("successfully added permission to bundle")
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-820.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Make settings service start without go coroutines

The go routines cause a race condition that sometimes causes the tests to fail. The ListRoles request would not return all permissions.

https://github.com/owncloud/ocis/pull/835

0 comments on commit 6c9005e

Please sign in to comment.