Skip to content

context.Set() doesn't lock the map for writing #273

Closed
@polds

Description

@polds

So I'm sure this was done on purpose for speed issues but recently ran into an issue where we had a middleware issuing unique Request IDs and saving them using context.Set(). Under high concurrency we found that requests began to start sharing request ids and found it was caused by the underlying map for the store not locking.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions