Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect entryCache with lock #262

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

sengleung
Copy link
Contributor

If ToEntry() is called concurrently after entryCache is cleared with ClearEntryCache(), then it is possible for a panic to occur as entryCache is being concurrently read/written.

Fixes #261

If ToEntry() is called concurrently after entryCache is cleared with
ClearEntryCache(), then it is possible for a panic to occur as
entryCache is being concurrently read/written.

Fixes openconfig#261
@coveralls
Copy link

coveralls commented Dec 13, 2023

Coverage Status

coverage: 83.744% (+0.1%) from 83.608%
when pulling d28b9ac on sengleung:entrycache-lock-fix
into 5ad0d2f on openconfig:master.

Copy link
Collaborator

@wenovus wenovus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this issue, one comment on usability.

pkg/yang/entry.go Outdated Show resolved Hide resolved
@wenovus wenovus merged commit 95c1617 into openconfig:master Dec 20, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Concurrent map access panic in ToEntry() if ClearEntryCache() is used
3 participants