RulesMap[repoName].State is in effect a global and is potentially shared between requests. Refactor this so that each request loads the state as needed and passes it directly to lower calls, similarly to what is done with Clients.
The following revision refers to this bug: https://chromium.googlesource.com/infra/infra/+/4b82bdc474e4db1b8df06f82e109ef352b031778 commit 4b82bdc474e4db1b8df06f82e109ef352b031778 Author: Roberto Carrillo <robertocn@google.com> Date: Mon Sep 18 19:12:29 2017 [cr-audit-commits] Move repo state out of the global repo config. This is to avoid race conditions as a single instance can serve multiple requests at the same time. R=chanli,stgao BUG= 765484 Change-Id: Ic5b77254daba5aae07498adb7e5e51f81bc15a79 Reviewed-on: https://chromium-review.googlesource.com/669141 Commit-Queue: Roberto Carrillo <robertocn@chromium.org> Reviewed-by: Shuotao Gao <stgao@chromium.org> [modify] https://crrev.com/4b82bdc474e4db1b8df06f82e109ef352b031778/go/src/infra/appengine/cr-audit-commits/app/commit_scanner.go [modify] https://crrev.com/4b82bdc474e4db1b8df06f82e109ef352b031778/go/src/infra/appengine/cr-audit-commits/app/status_test.go [modify] https://crrev.com/4b82bdc474e4db1b8df06f82e109ef352b031778/go/src/infra/appengine/cr-audit-commits/app/commit_auditor.go [modify] https://crrev.com/4b82bdc474e4db1b8df06f82e109ef352b031778/go/src/infra/appengine/cr-audit-commits/app/findit_rules_test.go [modify] https://crrev.com/4b82bdc474e4db1b8df06f82e109ef352b031778/go/src/infra/appengine/cr-audit-commits/app/status.go [modify] https://crrev.com/4b82bdc474e4db1b8df06f82e109ef352b031778/go/src/infra/appengine/cr-audit-commits/app/rules_config.go
Comment 1 by robert...@chromium.org
, Sep 15 2017