PROCESS_MEMORY_CACHE_TTL
cannot be large than int32
#666
Labels
bug
Something isn't working
cu
ao Compute Unit
good first issue
Good for newcomers
help wanted
Extra attention is needed
Background
The CU LRU In-Memory cache TTL can be configured using the
PROCESS_MEMORY_CACHE_TTL
. Underneath the hood, a cached record's ttl is implemented using a simplesetTimeout
Problem
NodeJS'
setTimeout
is implemented as a subroutine that uses a signed 32 bit integer to store the timeout time, in milliseconds. This means the maximum value forPROCESS_MEMORY_CACHE_TTL
is 2^31 - 1 or ~25 days.Setting
PROCESS_MEMORY_CACHE_TTL
to a higher value will cause Node to emit a warning and then implicitly overflow the integer. Subsequently, thesetTimeout
will be given a negative value and immediately be invoked. Basically disabling the LRU In-Mmeory cache.Solution
We'd like to allow larger values for
PROCESS_MEMORY_CACHE_TTL
. Can probably use something like long-timeout which abstracts recursively callingsetTimeout
to allow for setting longer timeouts.Developer Notes
Code to modified is here
The text was updated successfully, but these errors were encountered: