* KCL shardend fix for V1
* Address Comments
* Address more comments
* Force lease lost before shutting down ShardConsumer with Zombie state
* Updating version
* Addressing comments
* Addressing comments
* Fixing unit test
* Addressing comments
* Adding default implementation for onShardConsumerShutDown in ShardSyncStrategy interface
* Method name changes
* Addressing comments
* Addressing comments
* Addressing comments
* Revert the access change for getShardList method
* Changes to support injection of ShardSyncer, LeaseTaker, and LeaseRenewer into KCL Worker
* Additional checks around injection of LeaseRenewer and LeaseRenewerThreadPool
* Changed accessor on InitialPositionInStreamExtended to public to allow ShardSyncer injection
* Changed ShardSyncer to a public interface. Renamed implementation to KinesisShardSyncer.
* Removed wild card imports introduced in previous commit
* Minor refactoring in Worker Builder
* Added license info to ShardSyncer interface. Minor refactoring
* Changes to chain constructor in LeaseCoordinator
* Changed accessor on InitialPositionInStreamExtended factory methods. Minor changes in Worker builder.
* Changes to support periodic shard sync
* Patching changes left out in merge
* Overriding shard-sync idle time to 0 for periodic shard-sync
* Addressed PR feedback
* Addresed PR #579 review comments
* Modified constructor for DeterministicShuffleShardSyncLeaderDecider
* Addressed PR comments
* Fixed failing test
* Removed redundant member varible
* Re-enable metrics for shard-sync
* Removed unused method from ShardSyncTaskManager
* Changes to support injection of ShardSyncer, LeaseTaker, and LeaseRenewer into KCL Worker
* Additional checks around injection of LeaseRenewer and LeaseRenewerThreadPool
* Changed accessor on InitialPositionInStreamExtended to public to allow ShardSyncer injection
* Changed ShardSyncer to a public interface. Renamed implementation to KinesisShardSyncer.
* Removed wild card imports introduced in previous commit
* Minor refactoring in Worker Builder
* Added license info to ShardSyncer interface. Minor refactoring
* Changes to chain constructor in LeaseCoordinator
* Changed accessor on InitialPositionInStreamExtended factory methods. Minor changes in Worker builder.
* Changes to support periodic shard sync
* Patching changes left out in merge
* Overriding shard-sync idle time to 0 for periodic shard-sync
* Addressed PR feedback
* Addresed PR #579 review comments
* Modified constructor for DeterministicShuffleShardSyncLeaderDecider
* Addressed PR comments
* Fixed failing test
* Removed redundant member varible
* Add proxy support
Read proxy info from application.properties file first,
then java system settings, and finally from ENV vars.
* Formatted code according to AWS scheme.
Import specific classes, not *.
* Add proxy config unit tests
* Changed per @sahilpalvia comments
* Fix failing test
* Changed per @sahilpalvia comments
* Fixing missed http_proxy string
* Changed per @sahilpalvia comments
* Added cache updating behavior for GetShard
Customer are occasionally seeing messages about being unable to
retrieve shard information, which is logged as a warning. This change
will allow the shard map to be updated even when there is no re-shard
operation.
This now triggers a shard list update if there is 1000 cache misses,
or a cache miss occurs when the cache is more than 30 seconds old.
For Kinesis the updates will use ListShards, and for DynamoDB Streams
it will continue to use DescribeStream.
* Adjust some logging, and the zeroing of cache misses a bit
Only log about cache refresh if it's the thread doing the cache
refresh. If after synchronizing the shard is present, accept that
someone else loaded the shard map, and move on.
If the cache was reloaded, and the shard was found the current thread
will reset the cache misses.
The warnings for the cache miss was using a modulo of 1000 which is
the maximum value for cache misses, so wasn't to useful.
* Release 1.9.1 of the Amazon Kinesis Client Library for Java
Updated versions, and added release notes.
* Added note about the update of the AWS Java SDK
* Reformatting the constructors to be together in the Worker class.
* Using lombok annotations to replace setters in the Worker.Builder.
* Deprecating all the public constructors for the Worker class. Recommending to use the Worker.Builder to create the Worker object.
* Including annotation usage for leaseManager in the Worker.Builder
* Adding capability to support Immutable clients by the Worker and Worker.Builder
* Adding annotation support for WorkerStateChangeListener.
Fixes#48
* Fixing issue with NullMetrics warning messages when trying to checkpoint on a separate thread.
* Adding testing to validate the MetricsScope setting during checkpoiniting.
* Added IKinesisProxy injector in Worker.Builder to allow injecting custom proxy implementations
* Added unit tests for IKinesisProxy injection in Worker Builder
* Revert "Added unit tests for IKinesisProxy injection in Worker Builder"
This reverts commit aa944c1706.
Reverting to undo changes to import ordering.
* Added unit tests for IKinesisProxy injection in Worker Builder
Re-added unit tests after reverting changes to import ordering.
* Revert "Added unit tests for IKinesisProxy injection in Worker Builder"
This reverts commit 91e445774b.
Reverting to refactor unit tests.
* Added unit tests for Worker Builder IKinesisProxy injection validation
Refactored unit tests as per comments in the pull request.
* Added debug logs in KinesisLocalFileDataCreator
* Revert "Added debug logs in KinesisLocalFileDataCreator"
This reverts commit 1ff00d0b01.
* Edited JavaDoc for Worker Builder kinesisProxy
Allow unexpected child shards to be ignored
now instead of always throwing an assertion if a child shard has an
open parent, consider worker configuration before doing so. if
configured to ignore such shards, do not create leases for them during
shard sync. this is intended to mitigate failing worker init when
processing dynamodb streams with many thousands of shards (which can
happen for tables with thousands of partitions).
this new behavior can be enabled by adding the following to a
configuration/properties file:
```
ignoreUnexpectedChildShards = true
```
Release 1.8.8
* Fixed issues with leases losses due to `ExpiredIteratorException` in `PrefetchGetRecordsCache` and `AsynchronousFetchingStrategy`.
PrefetchGetRecordsCache will request for a new iterator and start fetching data again.
* PR#263
* Added warning message for long running tasks.
* PR#259
* Handling spurious lease renewal failures gracefully.
Added better handling of DynamoDB failures when updating leases. These failures would occur when a request to DynamoDB appeared to fail, but was actually successful.
* PR#247
* ShutdownTask gets retried if the previous attempt on the ShutdownTask fails.
* PR#267
* Fix for using maxRecords from `KinesisClientLibConfiguration` in `GetRecordsCache` for fetching records.
* PR#264
* Shutdown that throws an exception will be retried.
Without this change a transient error on shutdown with reason terminate prevents
child shards from starting.
* Fixing the tests for the Shutdown fix.
Fixes#262
Changing the signture of SingleRecordsFetcherFactory to no longer take maxRecords as the parameter to the constructor. Changed the createRecordsFetcher signature to take maxRecords as a parameter. (#264)
* Handle spurious lease renewal failures gracefully.
If the request to conditionally update a lease counter in DynamoDB fails, it's
considered a failure to renew the lease. This is a good thing, except if the
request failure was just because of connectivity problems. In this case the
counter *did* update in DynamoDB, but the Dynamo client retries the request
which then fails the update condition (since the lease counter no longer
matches expected value).
To handle this gracefully we opt to get the lease record from Dynamo and
examine the lease owner and counter. If it matches what we were expecting,
then we consider renewal a success.
Block the fetching thread when the queue is considered to be full.
This ensures that the thread won't spin the CPU when it can't retrieve
more records or bytes.
This adds that ability for the KCL to fetch records while the record processor is busy. This can help smooth out delays in record process, or retrieving data from Kinesis. Enabling this does require extra threads for background retrieval.
Settings
* dataFetchingStrategy: Which strategy to use to retrieve records. This can be either DEFAULT or PREFETCH_CACHED
* maxCacheByteSize: Retrieval will be paused when the total number of bytes in the cache exceeds this value
* maxRecordsCount: Retrieval will be paused when the total number of records in the cache exceeds this value
* maxPendingProcessRecordsInput: Retrieval will be paused when the total number of fulfilled requests in the cache exceeds this value
* Release 1.8.5 of the Amazon Kinesis Client for Java
Release 1.8.5 (September 26, 2017)
* Only advance the shard iterator for the accepted response.
This fixes a race condition in the `KinesisDataFetcher` when it's being used to make asynchronous requests. The shard iterator is now only advanced when the retriever calls `DataFetcherResult#accept()`.
* PR #230
* Issue #231
This changes the retriever strategy to only accept the shard iterator
when we have accepted a result to return. This is for the
asynchronous retriever where multiple threads may contend for the same
iterator slot. This ensures only the one selected for the response will
advance the shard iterator.
* Call shutdown on the retriever when the record processor is being shutdown
This fixes a bug that could leak threads if using the
AsynchronousGetRecordsRetrievalStrategy is being used.
The asynchronous retriever is only used when
KinesisClientLibConfiguration#retryGetRecordsInSeconds, and
KinesisClientLibConfiguration#maxGetRecordsThreadPool are set.
* PR #222
* Add support for two phase checkpoints
Applications can now set a pending checkpoint, before completing the checkpoint operation. Once the application has completed its checkpoint steps, the final checkpoint will clear the pending checkpoint.
Should the checkpoint fail the attempted sequence number is provided in the InitializationInput#getPendingCheckpointSequenceNumber otherwise the value will be null.
* PR #188
* Support timeouts, and retry for GetRecords calls.
Applications can now set timeouts for GetRecord calls to Kinesis. As part of setting the timeout, the application must also provide a thread pool size for concurrent requests.
* PR #214
* Notification when the lease table is throttled
When writes, or reads, to the lease table are throttled a warning will be emitted. If you're seeing this warning you should increase the IOPs for your lease table to prevent processing delays.
* PR #212
* Support configuring the graceful shutdown timeout for MultiLang Clients
This adds support for setting the timeout that the Java process will wait for the MutliLang client to complete graceful shutdown. The timeout can be configured by adding shutdownGraceMillis to the properties file set to the number of milliseconds to wait.
* PR #204
It's now possible to configure GetRecords calls to timeout if they
take to long. This can be used to terminate a long running request to
ensure that record processors continue to make progress
This feature was added with contributions from @pfifer, @sahilpalvia,
and @BtXin.
* Adding logging to ProvisionedThroughputExceededException.
* Addressing CR comments and changing log level from error to warn
* Updated the comments as per cr comments.
Adds support for making two phase commits. When a checkpoint is started, but fails to complete the next instance of the record processor will receive the attempted checkpoint position at initialization time.
Support timeouts for calls to the MultiLang Daemon
This adds support for setting a timeout when dispatching records to
the client record processor. If the record processor doesn't respond
within the timeout the parent Java process will be terminated. This
is a temporary fix to handle cases where the KCL becomes blocked
while waiting for a client record processor.
The timeout for the this can be set by adding
`timeoutInSeconds = <timeout value>`.
The default for this is no timeout.
Setting this can cause the KCL to exit suddenly, before using this
ensure that you have an automated restart for your application
Related #195
Related #185
* Adding timeout to waitForStatusMessage future call. Introducing new config properties timeoutEnabled and timeoutInSeconds. Halting the JVM if timeout is reached.
* Adding test cases for halt jvm code. Made the configuration objects for timeout optional.
* Addressing code review comments and making appropriate changes.
* Execute graceful shutdown on its own thread
* PR #191
* Issue #167
* Added support for controlling the size of the lease renewer thread pool
* PR #177
* Issue #171
* Require Java 8 and later
Java 8 is now required for versions 1.8.0 of the amazon-kinesis-client and later.
* PR #176
* Initial start of fix for requested shutdown
* Execute the requested shutdown in a separate thread.
Fix for Issue #167
* Reworked some of the shutdown logic to make the relationships clearer.
* Added/Updated Copyright Statements
* Add Missing License Statements
Allow configuration of the lease renewer thread pool size. Users can
now control the size of the pool. Additionally core threads are now
a quarter of the thread pool size, and aren't allowed to timeout.
When the parent Java process receives a SIGTERM it will now trigger a graceful shutdown of the worker, which dispatches a ShutdownRequestedMessage to all of the record processors. This will allow record processors a final chance to checkpoint before the lease is terminated.
This changes is incompatible with current versions of the MultiLang Clients. A future change will allow older versions MultiLang clients to use newer versions of the Java KCL.
Improve the handling of describe stream throttling by no longer
triggering a null pointer exception when all requests are throttled.
Also store the last position reached, and always restart from
there.