New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 852001 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 19
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 681516



Sign in to add a comment

Tricium didn't pick up all contents of playground project config

Project Member Reported by qyears...@chromium.org, Jun 12 2018

Issue description

Changes were recently made to the playground/gerrit-tricium repo project config:

https://chromium-review.googlesource.com/c/playground/gerrit-tricium/+/1093815
https://chromium-review.googlesource.com/c/playground/gerrit-tricium/+/1096116

This just involved changing one config file, not changing schema or anything.

luci-config appears to have picked up these changes
https://luci-config.appspot.com/#/projects/playground-gerrit-tricium
The content when fetched with apis-explorer also contains the new changes.

However, when Tricium fetches the config and logs the contents of the project config struct, it didn't contain the new changes. I added temporary logging to check whether this is the case everywhere that project configs are fetched, and confirmed: everywhere that Tricium fetches project configs, it didn't seem to pick up the new changes in the playground project config.

Example logged project config after updating configs:
project playground-gerrit-tricium, contents &tricium.ProjectConfig{Acls:[]*tricium.Acl{(*tricium.Acl)(0xc008bfa510)}, Functions:[]*tricium.Function(nil), Selections:[]*tricium.Selection{(*tricium.Selection)(0xc008bfa540), (*tricium.Selection)(0xc008bfa570), (*tricium.Selection)(0xc008bfa5a0), (*tricium.Selection)(0xc008bfa5d0)}, Repos:[]*tricium.RepoDetails{(*tricium.RepoDetails)(0xc008bfa600)}, ServiceAccount:"tricium-dev@appspot.gserviceaccount.com", SwarmingServiceAccount:"swarming@tricium-dev.iam.gserviceaccount.com"}
 
Blocking: 681516
Description: Show this description
After discussion with Nodir:

Currently tricium is using cfgclient ("go.chromium.org/luci/config/server/cfgclient") to make requests to luci-config. This library uses caching and doesn't always actually make requests to luci-config.

Actually making requests to luci-config is slow; fetching configs from luci-config is not really meant to be fast. Other services such as luci-notify handle this by using cron-jobs that regularly fetch new configs and store configs in datastore.

To do this for tricium, we would want to:

 - Add a cron job to fetch and store configs.
 - Instead of using cfgclient to fetch clients in other places: fetch configs from datastore.

See:
https://cs.chromium.org/chromium/infra/go/src/go.chromium.org/luci/luci_notify/config/config.go
https://cs.chromium.org/chromium/infra/go/src/go.chromium.org/luci/luci_notify/frontend/cron.yaml

Short-term fix to clear caches: Upload new version; clear memcache; delete old versions.
Labels: -Pri-1 Pri-2
Update; tried uploading new version / deleting old versions, and clearing memcache, but it still seems to be using stale version of project config for now.
Components: Infra>Platform>Tricium
Components: -Infra>CodeAnalysis
Labels: -Tricium
Project Member

Comment 7 by bugdroid1@chromium.org, Jul 19

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/infra/+/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d

commit c4700e49db12f969ad57422cfc5af3fc3cc7fb0d
Author: Quinten Yearsley <qyearsley@chromium.org>
Date: Thu Jul 19 21:20:38 2018

[tricium] Manage configs explicitly with a cron job and datastore

Background: Currently Tricium uses the
go.chromium.org/luci/config/server/cfgclient library
for fetching configs when they're needed. This appears to
have two disadvantages:

1. Ocasionally when a config is actually fetched, it takes
   about 5 seconds, occasionally adding delay to other
   operations (polling, starting analysis, etc.)
2. Sometimes a new config is not fetched when it should be,
   and a stale cached version is used ( crbug.com/852001 ).

This CL changes it so that configs are explicitly stored and
managed in the Tricium datastore, and updated periodically
by a cron job.

This CL keeps the interface and mocks the same, so that
other code that uses configs doesn't have to care about
how the configs are fetched or managed.

Bug:  852001 

Change-Id: I6a8740ce2edfb5691a6b98729a1611b0b4985d28
Reviewed-on: https://chromium-review.googlesource.com/1132547
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>

[modify] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/api/v1/gen.go
[add] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/appengine/common/config/update_test.go
[modify] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/appengine/frontend/rpc_report_test.go
[modify] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/api/v1/tricium.pb.go
[add] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/api/v1/proto_gae.gen.go
[modify] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/appengine/common/config/provider.go
[modify] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/appengine/frontend/cron.yaml
[add] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/appengine/common/config/storage.go
[modify] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/appengine/config/init.go
[add] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/appengine/common/config/storage_test.go
[modify] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/api/v1/pb.discovery.go
[add] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/appengine/common/config/update.go
[add] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/appengine/config/update.go
[modify] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/appengine/common/config/config.infra_testing
[add] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/appengine/common/config/workflow.go
[add] https://crrev.com/c4700e49db12f969ad57422cfc5af3fc3cc7fb0d/go/src/infra/tricium/api/v1/README.md

Status: Fixed (was: Assigned)
Config management is now changed.

Example of cron job logs after deploying:

First run:

 2018-07-19 15:11:40.400 PDT
 Found new service config. :: {"revision":"07c3044001c319a6a2782526891e6c25e1e6a26c"}
 2018-07-19 15:11:40.896 PDT
 Got config revisions for 7 projects.
 2018-07-19 15:11:41.119 PDT
 Found new project config. :: {"project":"luci-go", "revision":"0f4483886942b6ca660b2e4c1c8a6c400daffc1b"}
 2018-07-19 15:11:41.120 PDT
 Found new project config. :: {"project":"gerrit-tricium-integration", 
 "revision":"54bf8ddf9bcb4ffc748dd6fead98ececa95c98e5"}
 2018-07-19 15:11:41.142 PDT
 Found new project config. :: {"project":"chromiumos", "revision":"fa2b1a19c53b67a84acd5414f7024a632962414b"}
 2018-07-19 15:11:41.299 PDT
 Found new project config. :: {"project":"luci-py", "revision":"b8dc03b381227d127c6124fa5a97977577e912c2"}
 2018-07-19 15:11:41.317 PDT
 Found new project config. :: {"project":"playground-gerrit-tricium-demo", 
 "revision":"e189db0e778247b18cc9bf4a68985a8134c78dfb"}
 2018-07-19 15:11:41.324 PDT
 Found new project config. :: {"project":"pdfium", "revision":"d6699d70624d82aff65c1464c8800c291fa29148"}
 2018-07-19 15:11:41.350 PDT
 Found new project config. :: {"project":"fuchsia", "revision":"f19c18af2fe27fdb682e8f6c3e696928825a0660"}

Second run:

 2018-07-19 15:12:09.706 PDT
 Got config revisions for 7 projects.
 [nothing more]

Configs can be inspected in datastore and can be explicitly refreshed from the cron job page; it should now be when configs are actually refreshed.

Sign in to add a comment