Commit 145f109
authored
fix: concurrent map write for migrating schedules back to v1 (#10164)
## What changed?
Some observed panics in production spotted by @yycptt were causing
crashes. The mutation `searchattribute.AddSearchAttribute(&sa,
sadefs.TemporalNamespaceDivision,
payload.EncodeString(legacyscheduler.NamespaceDivision))` presumably
intermittently was happening while another read was happening elsewhere
in the system, causing a crash.
## Why?
Need to avoid panics in prod
## How did you test it?
- [X] built
- [ ] run locally and tested manually
- [X] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)
## Potential risks
Not expected to be high risk as it's just a clone, might need some more
test coverage however. I am unsure if we have enough coverage to ensure
there's no data drops1 parent d74eabf commit 145f109
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
155 | | - | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
168 | | - | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
| |||
0 commit comments