Skip to content
This repository was archived by the owner on Sep 23, 2018. It is now read-only.

Fix a bug in internalLockLoop(), where startTime is never updated.#9

Open
yh1213 wants to merge 1 commit into
curator-go:masterfrom
yh1213:master
Open

Fix a bug in internalLockLoop(), where startTime is never updated.#9
yh1213 wants to merge 1 commit into
curator-go:masterfrom
yh1213:master

Conversation

@yh1213

@yh1213 yh1213 commented Apr 17, 2018

Copy link
Copy Markdown

In Java version of curator:

if ( millisToWait != null )
    {
         millisToWait -= (System.currentTimeMillis() - startMillis);
        // start time is updated here
        startMillis = System.currentTimeMillis();
        if ( millisToWait <= 0 )
         {
             doDelete = true;    // timed out - delete our node
             break;
          }
           wait(millisToWait);
     }

In Java version of curator:
if ( millisToWait != null )
                            {
                                millisToWait -= (System.currentTimeMillis() - startMillis);
// start time is updated here
                                startMillis = System.currentTimeMillis();
                                if ( millisToWait <= 0 )
                                {
                                    doDelete = true;    // timed out - delete our node
                                    break;
                                }
                                wait(millisToWait);
                            }
@basvanbeek

Copy link
Copy Markdown
Contributor

Thanks for the PR. Can you please add a test that would fail for the current code but will succeed for this fix?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants