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

dyno_scan goes into infinite loop #291

Open
balajivenki opened this issue Mar 10, 2020 · 0 comments
Open

dyno_scan goes into infinite loop #291

balajivenki opened this issue Mar 10, 2020 · 0 comments

Comments

@balajivenki
Copy link
Contributor

When using dyno_scan to find keys with pattern the call goes into infinite loop and never finishes. The condition for isComplete never seem to return true because cursor value is never 0 after it scrolls.

com.netflix.dyno.jedis.CursorBasedResultImpl#isComplete

Here is the sample code I used to test the same

` System.out.println("SCAN TEST -- begin");
String keyPattern = "SetKey-41*";

    System.out.println("Reading keys  with pattern " + keyPattern);
    CursorBasedResult<String> cbi = null;

    Set<String> resultKeys = Sets.newHashSet();
    int count = 0;
    do {
        try {

            cbi = dynoJedisClient.dyno_scan(cbi, 50, keyPattern);
        } catch (PoolOfflineException ex) {
            System.out.println("Caught exception.... retrying scan");
            cbi = null;
            continue;
        }


        List<String> results = cbi.getResult();
        count += results.size();
        for (String res : results) {
            resultKeys.add(res);
        }
        System.out.println("Count: " + count);
    } while ((cbi == null) || !cbi.isComplete());`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant