Skip to main content

Brotli

This incident involved a Brotli compression library under Node.js v20.7.0 on Linux. The library installed its own uncaught-exception handler, interfering with the application's error handling in a production Kubernetes cluster.

Environment: Linux 5.10.226-214.880.amzn2.x86_64.

/home/pptruser/node_modules/brotli/build/encode.js:3
1<process.argv.length?process.argv[1].replace(/\\/g,"/"):"unknown-program");b.arguments=process.argv.slice(2);"undefined"!<mark>typeof module&&(module.exports=b);process.on("uncaughtException",function(a){if(!(a instanceof y))throw a;});b.inspect=function(){return"[Emscripten Module object]"}}else if(x)b.print||(b.print=print),"undefined"!=typeof printErr&&(b.printErr=printErr),b.read="undefined"!=typeof read?read:function(){throw"no read() available (jsc?)";},b.readBinary=function(a){if("function"</mark>=

This prevented the application's process.on('uncaughtException') handler from receiving the error. We fixed the immediate production issue by removing the Brotli library.

Share: