@cumulus/cumulus-message-adapter-js
Advanced tools
Comparing version
@@ -6,4 +6,18 @@ # Changelog | ||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
and this project adheres to [Semantic | ||
Versioning](http://semver.org/spec/v2.0.0.html). | ||
## [v1.3.2] 2020-10-13 | ||
### Fixed | ||
- Fixed issue causing spawned CMA process to left running/in the node event | ||
queue, resulting in AWS being unwilling/unable to clean up the instance. This resulted in lambdas with a memory leak/resource issues to not be | ||
reclaimed/restarted by AWS. | ||
- Fixed issue where the CMA child process was not cleaning up/deallocating | ||
buffered data when the parent process ends, creating a memory 'leak'. This | ||
commit updates the error handling to issue SIGTERM/SIGINT in case of error, | ||
allowing the subprocess to exit properly. | ||
## [v1.3.1] 2020-07-31 | ||
@@ -10,0 +24,0 @@ |
@@ -78,6 +78,11 @@ "use strict"; | ||
cmaProcess.on('close', () => { | ||
console.log(`CMA Exit Code: ${cmaProcess.exitCode} `); | ||
if (cmaProcess.exitCode !== 0) { | ||
console.log(`CMA Failure: ${errorObj.stderrBuffer}`); | ||
if (cmaProcess.killed !== true) { | ||
console.log(`CMA Exit Code: ${cmaProcess.exitCode} `); | ||
if (cmaProcess.exitCode !== 0) { | ||
console.log(`CMA Failure: ${errorObj.stderrBuffer}`); | ||
} | ||
} | ||
else { | ||
console.log('CMA process killed'); | ||
} | ||
}); | ||
@@ -167,8 +172,8 @@ cmaProcess.stderr.on('data', (data) => { | ||
var _a; | ||
const { cmaProcess, errorObj } = await invokeCumulusMessageAdapter(); | ||
const cmaStdin = cmaProcess.stdin; | ||
const rl = readline.createInterface({ | ||
input: cmaProcess.stdout | ||
}); | ||
try { | ||
const { cmaProcess, errorObj } = await invokeCumulusMessageAdapter(); | ||
const cmaStdin = cmaProcess.stdin; | ||
const rl = readline.createInterface({ | ||
input: cmaProcess.stdout | ||
}); | ||
cmaStdin.write('loadAndUpdateRemoteEvent\n'); | ||
@@ -217,2 +222,12 @@ cmaStdin.write(JSON.stringify({ | ||
catch (error) { | ||
try { | ||
cmaStdin.write('\n<EOC>\n'); | ||
cmaStdin.write('\n<EXIT>\n'); | ||
if (!cmaProcess.kill('SIGTERM')) { | ||
cmaProcess.kill('SIGKILL'); | ||
} | ||
} | ||
catch (e) { | ||
console.log(`CMA process failed to kill on task failure: ${JSON.stringify(e)}`); | ||
} | ||
if (((_a = error === null || error === void 0 ? void 0 : error.name) === null || _a === void 0 ? void 0 : _a.includes('WorkflowError')) && (!typeGuards_1.isCMAMessage(cumulusMessage))) { | ||
@@ -219,0 +234,0 @@ return { ...cumulusMessage, payload: null, exception: error.name }; |
{ | ||
"name": "@cumulus/cumulus-message-adapter-js", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Cumulus message adapter", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
52571
2.81%430
3.61%1
-50%