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

Result hasNext() Hangs Forever #58

Open
moloch-- opened this issue Oct 15, 2020 · 0 comments
Open

Result hasNext() Hangs Forever #58

moloch-- opened this issue Oct 15, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@moloch--
Copy link

Describe the bug

I'm running into an odd bug where result.hasNext() hangs forever after successfully iterating through all of the expected results of a query. I have an application where I need to load the contents of a table at startup, which I've implemented like so:

    private Table http() {
        return r.db(dbName).table(HTTPTable);
    }

    private void initalizeHistory() {
        logger.debug("Initializing history ...");
        try {
            Result<MultiplayerRequestResponse> result = http().run(dbConn, MultiplayerRequestResponse.class);
            logger.debug("Got history ...");
            while (result.hasNext()) {
                MultiplayerRequestResponse entry = result.next();
                logger.debug("Got entry: %s", entry);
                history.add(entry);
            }
            logger.debug("Results done.");
        } catch(Exception err) {
            logger.error(err);
        }
        logger.debug("History initialized");
    }

When the code runs I get the following in the log files, it loads the expected data but then the hasNext() hangs forever when it should terminate the loop. Note that I never get the Results done. or History initialized log messages from the code. I can also comment out the history.add(entry) code and observe the same behavior, so it would seem to be an issue with the Java driver:

Successfully connected: com.rethinkdb.net.Connection@636a9651
Initializing history ...
Got history ...
Got entry: <id: b4d5b0d0a40aa9aada0ba6d9d3fecdb66957e702, method: GET, protocol: https, host: www.bishopfox.com, port: 443, path: /services/, comment: >
Got entry: <id: 0e42eddb67a6a871b27018e3aef4ae3a521fa21d, method: GET, protocol: https, host: api.hubapi.com, port: 443, path: /hs-script-loader-public/v1/config/pixel/json, comment: >
Got entry: <id: 2cd12678b8d72e5a597e49a7c0abac2415638c75, method: GET, protocol: https, host: api.hubspot.com, port: 443, path: /livechat-public/v1/message/public, comment: >
Got entry: <id: f9eaea5653fab7033e6d3975fd0705f15ea874a8, method: OPTIONS, protocol: https, host: api.hubspot.com, port: 443, path: /livechat-public/v1/message/public, comment: >

... and then the app dies, hanging forever.

System info

  • Java: 13.0.1
  • RethinkDB Version: rethinkdb 2.4.1~0buster (CLANG 7.0.1 (tags/RELEASE_701/final))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant