OCSP cache doesn’t have a means of clearing all cache invalidation check intervals
- Dominant language
- JavaScript
- Stars
- 86
- Forks
- 46
- PR merge metrics
- No merged PRs in 30d
Description
## Use case
While running unit tests that use the OCSP cache, the Node process does not exits due to active handles (the cache expiry intervals)
## Suggested fix
Add a method that clears the cache and cache expiry interval checks. e.g.,
```js
Cache.prototype.clear = function clear() {
var cacheIds = Object.keys(this.cache);
cacheIds.forEach(function (cacheId) {
clearInterval(this.cache[cacheId].timer);
})
this.cache.length = 0;
};
```
## Workaround
In your app, clear the intervals manually. e.g., in my app:
```js
const ocspCache = new ocsp.Cache()
// …
const cacheIds = Object.keys(ocspCache.cache)
cacheIds.forEach(cacheId => {
clearInterval(ocspCache.cache[cacheId].timer)
})
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate the OCSP Cache implementation and inspect how cache entries store their expiry interval. Add a public clearing entry point that removes cached entries and stops every expiry check, then run the existing unit-test suite to confirm Node exits without active cache timers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100