You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "songzhendong (via GitHub)" <gi...@apache.org> on 2026/09/19 03:50:12 UTC
[PR] fix: histogram NoInit panic and RuntimeContext map race [skywalking-go]
songzhendong opened a new pull request, #255:
URL: https://github.com/apache/skywalking-go/pull/255
## Summary
- Fix `newHistogramFromExistingBuckets` allocating with `make([]*histogramBucket, 0, n)` then writing by index (panic on first NoInit histogram conversion at meter collect). Use `make(..., len(buckets))` and keep existing bucket counters.
- Add `RWMutex` to `RuntimeContext` `Get`/`Set`/`clone`, consistent with `CorrelationContext`. Production GLS is per-goroutine and `TakeSnapShot`/`ContinueContext` already clone, so this is primarily defensive against residual shared-map paths that would otherwise fatal with concurrent map read/write.
- Add unit coverage; name the concurrency test `TestRace*` so `make test-race` runs it under the race detector.
## Test plan
- [x] Internal CI on `songzhendong/skywalking-go` (CI / E2E / Plugin / Windows)
- [x] `go test ./plugins/core -run 'TestNewHistogramFromExistingBucketsLen|TestRaceRuntimeContextConcurrentCloneAndSet'`
- [ ] `make test-race` (or `go test -race -run '^TestRace' ./plugins/core`)
- [ ] Official Apache CI on this PR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: histogram NoInit panic and RuntimeContext map race [skywalking-go]
Posted by "songzhendong (via GitHub)" <gi...@apache.org>.
songzhendong commented on PR #255:
URL: https://github.com/apache/skywalking-go/pull/255#issuecomment-5740121338
Thanks for the review. I've updated `CHANGES.md` under the **0.8.0** section:
```markdown
#### Bug Fixes
* Fix panic when converting NoInit histograms during meter collect.
* Fix concurrent map access in RuntimeContext Get/Set/clone.
```
Putting it in **0.8.0** follows the current changelog layout: `0.7.0` is the latest released version, and `0.8.0` is the open / unreleased section started in #253 (milestone 0.8.0). New fixes that land before the next release go there rather than under `0.7.0`.
Please let me know if you'd prefer a single combined bullet instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: histogram NoInit panic and RuntimeContext map race [skywalking-go]
Posted by "mrproliu (via GitHub)" <gi...@apache.org>.
mrproliu merged PR #255:
URL: https://github.com/apache/skywalking-go/pull/255
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org