Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worker does not complete shutdown on request when it is without active lease. #128

Closed
garfieldatwork opened this issue Jan 10, 2017 · 1 comment
Labels
Milestone

Comments

@garfieldatwork
Copy link

The scenario is -
a) I have a cluster of Workers (size n) against a Stream (shard count m). m < n. So some Workers are without active lease.
b) On doing requestShutdown(), the worker returns an immediateFuture
c) Since ShutdownFuture is not returned, shutdown() for Worker is never called which is normally done here
d) Worker does not stop.

A work-around I am doing is to always call shutdown() for the worker after doing a get() on the future. However, a proper fix seems to do the following in requestShutdown() -

        if (leases == null || leases.isEmpty()) {
            //
            // If there are no leases shutdown is already completed.
            //
            shutdown();
            return Futures.immediateFuture(null);
        }

Since there is no lease, shutdown() should be quick.

An alternate solution will be - to return ShutdownFuture in all scenarios with minor changes.

Suggestions?

@pfifer pfifer added the bug label Jan 13, 2017
@pfifer pfifer added this to the Release 1.7.4 milestone Jan 23, 2017
pfifer added a commit to pfifer/amazon-kinesis-client that referenced this issue Feb 27, 2017
* Fixed an issue building JavaDoc for Java 8.
  * [Issue awslabs#18](awslabs#18)
  * [PR awslabs#141](awslabs#141)
* Reduce Throttling Messages to WARN, unless throttling occurs 6 times consecutively.
  * [Issue awslabs#4](awslabs#4)
  * [PR awslabs#140](awslabs#140)
* Fixed two bugs occurring in requestShutdown.
  * Fixed a bug that prevented the worker from shutting down, via requestShutdown, when no leases were held.
    * [Issue awslabs#128](awslabs#128)
  * Fixed a bug that could trigger a NullPointerException if leases changed during requestShutdown.
    * [Issue awslabs#129](awslabs#129)
  * [PR awslabs#139](awslabs#139)
* Upgraded the AWS SDK Version to 1.11.91
  * [PR awslabs#138](awslabs#138)
* Use an executor returned from `ExecutorService.newFixedThreadPool` instead of constructing it by hand.
  * [PR awslabs#135](awslabs#135)
* Correctly initialize DynamoDB client, when endpoint is explicitly set.
  * [PR awslabs#142](awslabs#142)
pfifer added a commit that referenced this issue Feb 27, 2017
* Fixed an issue building JavaDoc for Java 8.
  * [Issue #18](#18)
  * [PR #141](#141)
* Reduce Throttling Messages to WARN, unless throttling occurs 6 times consecutively.
  * [Issue #4](#4)
  * [PR #140](#140)
* Fixed two bugs occurring in requestShutdown.
  * Fixed a bug that prevented the worker from shutting down, via requestShutdown, when no leases were held.
    * [Issue #128](#128)
  * Fixed a bug that could trigger a NullPointerException if leases changed during requestShutdown.
    * [Issue #129](#129)
  * [PR #139](#139)
* Upgraded the AWS SDK Version to 1.11.91
  * [PR #138](#138)
* Use an executor returned from `ExecutorService.newFixedThreadPool` instead of constructing it by hand.
  * [PR #135](#135)
* Correctly initialize DynamoDB client, when endpoint is explicitly set.
  * [PR #142](#142)
@pfifer
Copy link
Contributor

pfifer commented Feb 27, 2017

This has been fixed in release 1.7.4. Please reopen if you are still seeing this occur.

@pfifer pfifer closed this as completed Feb 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants