Skip to content

Stream keys on pbc issues, with early close of the stream [JIRA: CLIENTS-1051] #507

Open
@Guibod

Description

@Guibod

If you close a stream before it is finished, then it still try to drain an opened socket with incoming data.
Maybe you should close the resource instead of releasing it in such a case.

    def close(self):
        # We have to drain the socket to make sure that we don't get
        # weird responses when some other request comes after a
        # failed/prematurely-terminated one.
        try:
            while self.next():
                pass
        except StopIteration:
            pass
        self.resource.release()

Of course you cannot achieve that with the client wrapper that yields results through an iterator, and is not closeable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions