Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-1524

Improve handling of streaming result error situations

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • 4.x
    • 4.1.8
    • None
    • None
    • 0

    Description

      Currently if the streaming result times out when waiting to retrieve a row from the queue, a `StopIteration` exception is raised and that exception is not being handled in the `get_next_row` method, but instead it is handled in the `next` method. This could be problematic b/c the handling of `StopIteration` in the `next_` method assumes a normal end to the iteration (i.e. we ended b/c there are no more results) so we then proceed to grab metadata.

      NOTE: this impacts all streaming operations (analytics, n1ql, search and view).

      This raises a couple of questions:

      • How we handle this situation? Retries? Add extra time to the streaming_timeout based on the streaming operation's timeout?
      • If this `StopIteration` should terminate streaming, what to we raise to the user?
      • Maybe we raise a different error from the streaming result?
      • What about the situation where attempting to get metadata fails due to a timeout waiting to retrieve a row from the queue?

      With the changes in PYCBC-1521 the SDK now retries in the situation where it receives a `StopIteration` due to a time out when waiting to retrieve a row from the queue. This is essentially the same as using 2x the streaming operation's timeout value. I do not think users should run into this situation (I only see it when I wanted to force , but I would prefer to have as many code paths covered as possible.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jared.casey Jared Casey
            jared.casey Jared Casey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty