The supervisor memory configuration supports boxSize as either a number or a human-readable string such as "1KB".
createMemoryPool() already resolves string values correctly through parseBoxSize(), but worker-side memory operations currently use:
Number(config.memory.boxSize)
This works for numeric values like 1024, but fails for string values like "1KB" because Number("1KB") returns NaN.
This can break worker-side ctx.write() and ctx.read() operations when the supervisor is configured with a string boxSize.
Example configuration:
createSupervisor({
maxActors: 5,
memory: {
poolSize: 2,
boxSize: "1KB",
},
timeouts: {
defaultLeaseMs: 2000,
},
});
Expected behavior:
Worker memory operations should support the same boxSize formats as createMemoryPool().
Suggested fix:
Use parseBoxSize(config.memory.boxSize) inside worker memory read/write operations instead of Number(config.memory.boxSize).
A regression test should verify that an actor can write and read shared-memory data when boxSize is configured as "1KB".
The supervisor memory configuration supports
boxSizeas either a number or a human-readable string such as"1KB".createMemoryPool()already resolves string values correctly throughparseBoxSize(), but worker-side memory operations currently use:This works for numeric values like
1024, but fails for string values like"1KB"becauseNumber("1KB")returnsNaN.This can break worker-side
ctx.write()andctx.read()operations when the supervisor is configured with a stringboxSize.Example configuration:
Expected behavior:
Worker memory operations should support the same
boxSizeformats ascreateMemoryPool().Suggested fix:
Use
parseBoxSize(config.memory.boxSize)inside worker memory read/write operations instead ofNumber(config.memory.boxSize).A regression test should verify that an actor can write and read shared-memory data when
boxSizeis configured as"1KB".