Describe the bug
A large batchWrite operation timed out. The resulting error was logged using Pino, and the error object included command.args, which contained the entire request payload. Logging the full payload effectively duplicated it in memory, causing the process to exceed its memory limit and terminate with an out-of-memory (OOM) error.
To Reproduce
Execute a batchWrite operation with a sufficiently large payload. Force the operation to timeout (or otherwise fail).
Log the resulting error object using a logger such as Pino using the logger.error({ err }, 'msg...) syntax.
Observe that the error contains command.args with the full request payload. The process memory spikes due to the duplicated payload and may eventually crash with an OOM.
Expected behavior
The error object should not include the full command.args payload, or at least should avoid retaining or serializing large request payloads by default. This prevents excessive memory usage during error logging.
Versions and Environment Client application OS: Linux (production) Aerospike Client Version: 6.7.1 Aerospike Database Version: 7.x.x
Additional context
In our case, the payload was already resident in memory as part of the batchWrite request. Including the entire command.args object in the error effectively duplicated that payload during logging, which was enough to push the process over its memory limit and trigger an OOM.
\\\"name\\\":\\\"AerospikeError\\\",\\\"code\\\":9,\\\"command\\\":{\\\"client\\\":{\\\"_events\\\":{},\\\"_eventsCount\\\":0,\\\"config\\\":{\\\"port\\\":3000,\\\"hosts\\\":\\\"aerospike.prod.use1.ludeo.local:3000\\\",\\\"policies\\\":{\\\"remove\\\":{\\\"socketTimeout\\\":5000,\\\"totalTimeout\\\":5000,\\\"durableDelete\\\":true},\\\"read\\\":{\\\"socketTimeout\\\":5000,\\\"totalTimeout\\\":5000,\\\"maxRetries\\\":3},\\\"scan\\\":{\\\"socketTimeout\\\":5000,\\\"totalTimeout\\\":5000,\\\"maxRetries\\\":3},\\\"operate\\\":{\\\"socketTimeout\\\":5000,\\\"totalTimeout\\\":5000,\\\"durableDelete\\\":true},\\\"write\\\":{\\\"socketTimeout\\\":5000,\\\"totalTimeout\\\":5000,\\\"key\\\":1,\\\"exists\\\":0,\\\"durableDelete\\\":true},\\\"batch\\\":{},\\\"batchWrite\\\":{\\\"ttl\\\":21600,\\\"key\\\":1,\\\"exists\\\":0}},\\\"log\\\":{\\\"level\\\":2,\\\"file\\\":2},\\\"useAlternateAccessAddress\\\":false},\\\"as_client\\\":{},\\\"connected\\\":true,\\\"captureStackTraces\\\":false},\\\"args\\\":[[{\\\"type\\\":1,\\\"key\\\":{\\\"ns\\\":\\\"user-profile\\\",\\\"set\\\":\\\"object_attributes\\\",\\\"key\\\":\\\"8BF926E44D89645E093AAD848C58470E-1-30\\\",\\\"digest\\\":{\\\"type\\\":\\\"Buffer\\\",\\\"data\\\":[104,5,159,71,216,228,204,86,19,9,50,182,9,93,192,176,128,161,137,170]}},\\\"ops\\\":[{\\\"op\\\":0,\\\"bin\\\":\\\"roomId\\\",\\\"value\\\":\\\"8BF926E44D89645E093AAD848C58470E\\\"},{\\\"op\\\":0,\\\"bin\\\":\\\"innerObjectId\\\",\\\"value\\\":\\\"8BF926E44D89645E093AAD848C58470E-1\\\"},{\\\"op\\\":0,\\\"bin\\\":\\\"innerKeyId\\\",\\\"value\\\":\\\"8BF926E44D89645E093AAD848C58470E-1-30\\\"},{\\\"op\\\":0,\\\"bin\\\":\\\"data\\\",\\\"value\\\":\\\"{\\\\\\\"value\\\\\\\":\\\\\\\"R1ZBUwMAAAAKAgAA9QMAAAUABQAEAFYZBYAOAAAAKytUaXRhbitMdWRlbwADAAAAWgAAACLVVJy+TyaoRgchlNCCtGEsAAAAo1yRYvdLjhzHEg6j950hyCQAAAAkDUDMe07p4IOi+ZsnwMDcAAAAAOQy2LANT4kft37PrKJK/TYKAAAAKEPG4VNNLKKGjmyjjL0XZAAAAAA8wV43+0jkBvCEALV+cSomBAAAAO1osOTpQpT0C9oxokG7Ri4oAAAAP3T8z4BEsEPfFJGTcyAdFyUAAAC1SSuw6UQgu7cyBKNgA+RSAwAAAFwQ5KS1SaFZxEDFp+7fflQAAAAAyTHIOdxH5loXnESafI4cPgAAAAAzG/B4mE/q6+qEtLmiWrnMFAAAAA84MWbgQ00tJ88JgFqpVmkAAAAAn4v4EvxKdYgM2XymKb06ODEAAABM51p7EExw0phXWKlaKiELDQAAABhpKdfdS9YdqGTinYQ4wTwDAAAAeFKhwv5K57//kBdsVfcdUwEAAADUo6xuwUzsQO2LhrfFj0IJAwAAAN115SknRqPgdtIQnercLCMRAAAAXaZDr0dJ03+OPnOYBbvB2Q8AAADsbCZrj0vHHtnkC6MH/EIJAQAAAGE99w3qRz+i6Yknt5pJQQwBAAAAhhgdYIRPZKze0xaq1sfqDaoAAABbLLyN4EOnVLv8aKdgkKJ9CAAAALcGTFv4SmMkcL9bgN3Q9c0NAAAAaGMI51hMI2twGzmEkV4mFg8AAADWvP+dWAActivity
0No activity yet.