repo-updater: race condition on inserting repo without ID
Created by: keegancsmith
There is a potential race condition when inserting a repo. This is new and is most likely related to the work done to support soft deleting a repository. #6859 (closed)
18:37:41 repo-updater | panic: repo.id is zero
18:37:41 repo-updater | goroutine 184 [running]:
18:37:41 repo-updater | github.com/sourcegraph/sourcegraph/cmd/repo-updater/repos.(*schedule).upsert(0xc00036e100, 0xc001bfdda0, 0x0)
18:37:41 repo-updater | /Users/thorstenball/work/sourcegraph/cmd/repo-updater/repos/scheduler.go:622 +0x364
18:37:41 repo-updater | github.com/sourcegraph/sourcegraph/cmd/repo-updater/repos.(*updateScheduler).upsert(0xc000279600, 0xc0017980e0)
18:37:41 repo-updater | /Users/thorstenball/work/sourcegraph/cmd/repo-updater/repos/scheduler.go:259 +0x70
18:37:41 repo-updater | github.com/sourcegraph/sourcegraph/cmd/repo-updater/repos.(*updateScheduler).Update(0xc000279600, 0xc001c13988, 0x1, 0x1)
18:37:41 repo-updater | /Users/thorstenball/work/sourcegraph/cmd/repo-updater/repos/scheduler.go:249 +0x17d
18:37:41 repo-updater | github.com/sourcegraph/sourcegraph/cmd/repo-updater/shared.watchSyncer(0x2ff1be0, 0xc000052110, 0xc00038c180, 0x2fcbf60, 0xc000279600, 0xc000279940)
18:37:41 repo-updater | /Users/thorstenball/work/sourcegraph/cmd/repo-updater/shared/main.go:251 +0x325
18:37:41 repo-updater | created by github.com/sourcegraph/sourcegraph/cmd/repo-updater/shared.Main
18:37:41 repo-updater | /Users/thorstenball/work/sourcegraph/cmd/repo-updater/shared/main.go:186 +0x2051