lifion-kinesis
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -7,2 +7,9 @@ ### Changelog | ||
#### [v1.0.12](https://github.com/lifion/lifion-kinesis/compare/v1.0.11...v1.0.12) | ||
> 23 August 2019 | ||
- Add test coverage for when stopping consumers on start failure [`f02d3d0`](https://github.com/lifion/lifion-kinesis/commit/f02d3d08c1bc336c4d0ed467ad263ecc5cda4448) | ||
- Make the consumer manager not be forced to wait until for the resolution of the start of a single consumer [`9c156be`](https://github.com/lifion/lifion-kinesis/commit/9c156be9c24c8f5321fbbdb2d8e122693f88746b) | ||
#### [v1.0.11](https://github.com/lifion/lifion-kinesis/compare/v1.0.10...v1.0.11) | ||
@@ -9,0 +16,0 @@ |
@@ -184,3 +184,3 @@ /** | ||
consumers[shardId] = consumer; | ||
await consumer.start(); | ||
consumer.start(); | ||
} catch (err) { | ||
@@ -187,0 +187,0 @@ logger.error('Unexpected recoverable error when trying to start a consumer:', err); |
@@ -270,4 +270,13 @@ /** | ||
const { shardsPath, shardsPathNames } = await stateStore.getShardsData(); | ||
let shardsPath; | ||
let shardsPathNames; | ||
try { | ||
({ shardsPath, shardsPathNames } = await stateStore.getShardsData()); | ||
} catch (err) { | ||
logger.warn("Can't start the consumer as the state can't be resolved:", err); | ||
stopConsumer(shardId); | ||
return; | ||
} | ||
const requestFlags = {}; | ||
@@ -284,3 +293,3 @@ let stream; | ||
if (headers['content-type'] !== AWS_EVENT_STREAM || statusCode !== 200) { | ||
logger.error(`Subscription unsuccessful: ${statusCode}`); | ||
logger.warn(`Subscription unsuccessful: ${statusCode}`); | ||
requestFlags.isEventStream = false; | ||
@@ -354,3 +363,6 @@ reportError('kinesis', { statusCode }, streamName); | ||
const { code, message, requestId, statusCode } = err; | ||
if (!shouldBailRetry(err)) { | ||
const isArnInUseError = | ||
code === 'ResourceInUseException' && | ||
message.includes('Another active subscription exists'); | ||
if (!shouldBailRetry(err) || isArnInUseError) { | ||
logger.warn( | ||
@@ -357,0 +369,0 @@ [ |
@@ -211,3 +211,3 @@ /** | ||
try { | ||
logger.debug('Trying to acquire leases…'); | ||
logger.debug('Attempting lease acquisition…'); | ||
@@ -214,0 +214,0 @@ const { streamArn } = await checkIfStreamExists(privateProps); |
@@ -258,5 +258,15 @@ /** | ||
const privateProps = internal(this); | ||
const { shardId, stateStore } = privateProps; | ||
const { shardsPath, shardsPathNames } = await stateStore.getShardsData(); | ||
const { logger, shardId, stateStore, stopConsumer } = privateProps; | ||
let shardsPath; | ||
let shardsPathNames; | ||
try { | ||
({ shardsPath, shardsPathNames } = await stateStore.getShardsData()); | ||
} catch (err) { | ||
logger.warn("Can't start the consumer as the state can't be resolved:", err); | ||
stopConsumer(shardId); | ||
return; | ||
} | ||
privateProps.setCheckpoint = async sequenceNumber => { | ||
@@ -263,0 +273,0 @@ await stateStore.storeShardCheckpoint(shardId, sequenceNumber, shardsPath, shardsPathNames); |
@@ -283,2 +283,5 @@ /** | ||
const { isUsedBy } = enhancedConsumers[consumerName]; | ||
if (isUsedBy == null) { | ||
return false; | ||
} | ||
if (oldConsumers.includes(isUsedBy)) { | ||
@@ -285,0 +288,0 @@ logger.debug(`Enhanced consumer "${consumerName}" can be released, missed heartbeat.`); |
{ | ||
"name": "lifion-kinesis", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "Lifion client for Amazon Kinesis Data streams", | ||
@@ -53,3 +53,3 @@ "keywords": [ | ||
"async-retry": "^1.2.3", | ||
"aws-sdk": "^2.514.0", | ||
"aws-sdk": "^2.516.0", | ||
"aws4": "^1.8.0", | ||
@@ -95,5 +95,5 @@ "fast-deep-equal": "^2.0.1", | ||
"template": "public", | ||
"updated": "2019-08-20T20:54:06.146Z", | ||
"version": "2.2.0" | ||
"updated": "2019-08-23T18:18:36.111Z", | ||
"version": "2.3.1" | ||
} | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
190548
3903
0
Updatedaws-sdk@^2.516.0