When Kinesis shards have no data, there can be a race condition where
the shard-end record processing from RecordProcessorThread
interleaves with Scheduler performing initialization.
This leads to ShardConsumer making incorrect state transition
during initialization (moves from PROCESSING -> SHUTTING_DOWN) state
and during shutdown handling it moves from SHUTTING_DOWN -> SHUTDOWN_COMPLETE
without running the ShutdownTask.
This can cause the ShardConsumer to not perform proper shutdown
processing that is required for a child shard processing
to be unblocked. So the child shard could be blocked forever unless the
lease for the parent shard moves to a new worker and that worker does
not run into the race condition.
This patch fixes the race condition as follows:
The intializationComplete invocation is not needed after
needsInitialization has been set to false. Because initializationComplete
is mean to perform initialization in an async manner, but once
its done, the async task is a no-op in happy-path, but it can
perform incorrect state transition during a race condition.
* create script to check for backwards compatibility
* move scripts directory to .github folder
* add execute permissions to script
* moved the 'continue' call to the find_removed_methods() function
* add function to check if minor release is being performed
* Upgrade version to 2.6.0-SNAPSHOT
* modify ShutdownTask to call shutdownComplete for graceful shutdown
* add test to verify ShutdownTask succeeds regardless of shutdownNotification
* change access level for finalShutdownLatch to NONE
* remove unused variable in GracefulShutdownCoordinator
* make comment more concise
* move waitForFinalShutdown method into GracefulShutdownCoordinator class
* cleanup call method of GracefulShutdownCoordinator
* modify waitForFinalShutdown to throw InterruptedException
* Upgrade ch.qos.logback:logback-classic dependency from 1.3.12 to 1.5.1 in /amazon-kinesis-client and /amazon-kinesis-client-multilang and aws-java-sdk.version from 1.12.405 to 1.12.668 in /amazon-kinesis-client-multilang
* Upgrade ch.qos.logback:logback-classic dependency from 1.5.1 to 1.3.14 in /amazon-kinesis-client and /amazon-kinesis-client-multilang and upgrade awssdk.version from 2.20.43 to 2.25.3
* upgrade awssdk.version from 2.20.43 to 2.25.3
* Upgrade gsr.version from 1.1.17 to 1.1.19
---------
Co-authored-by: Brendan Lynch <brenplyn@amazon.com>
* Move throwOnIllegalState call to drain queue method to prevent improper error logging during worker shutdown
* Fix unit tests that expected IllegalStateException thrown
* Changed names of unit tests to reflect new behavior
Fix an issue where the idleTimeBetweenReadInMillis configured
via MultiLangDaemon was not taking effect because it used
the auto-generated setter from Lombok to set the configured value,
while there is a custom setter that must be invoked to set the
value correctly.
There is also a general confusion between using Lombok's setter vs
custom setter in java.
Unifying the approach to use the custom Lombok-fluent-style setter
and deprecating the previously added custom setIdleTimeBetweenReadsInMillis
Correct way to configure idleTimeBetweenReadsInMillis for MultiLang is
to add this in the properties file:
idleTimeBetweenReadsInMillis = 10000 # 10 seconds
Correct way to configure for java:
configsBuilder.retrievalConfig().retrievalSpecificConfig(
new PollingConfig(streamName, kinesisClient)
.idleTimeBetweenReadsInMillis(Duration.ofSeconds(10).toMillis())
Issues: #999, #950, #515
* Added doc for leases and the lease lifecycle.
* Documentation: addressed comments for leases.
+ minor code cleanup
* Documentation: language review.
+ decomposed shard sync UML into two separate diagrams (initialization, loop)
* Documentation: language review touch-ups.
* [#367] Enhanced multi-lang `AWSCredentialsProvider=...` decoder and construction.
+ added support for external ids (issue #367)
+ added support for endpoint+region (e.g., STS via VPC)
* Multiple multi-lang edits to introduce logging and additional tests.
+ added `ENDPOINT_REGION` nested key for a simpler Cx experience
+ deduplicated, and improved, logic w.r.t. CredentialsProvider
construction to NOT swallow Exceptions
* Relocated `multilang.properties` from `main/resources` to `test/resources`