-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Streamlined the locks for the active request registry.
We eliminate the pooled locks for simplicity. The period of lock contention is so short - we're just adding/removing paths from an in-memory map - that it's not worth the complexity to handle a lock pool. The process of removing each request path from the registry is now in a goroutine that is spawned when the path is added to the registry. This guarantees that the expiry happens in a timely manner. We no longer remove the file at the request path as (i) the active registry protects against replays, (ii) we'd like to use it as a log of recent requests and (iii) we already have a job that purges old files anyway. The creation of a new activeRequestRegistry now requires that a staging directory be supplied; no point splitting the creation and prefilling. Similarly, the expiry time is stored in the registry object for convenience.
- Loading branch information
Showing
3 changed files
with
88 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters