Skip to content

Improve error handling when a request fails due to the persistent connection being expired  #761

Open

Description

@timabbott

Some networks drop long-lived inactive TCP connections, which can lead to connection errors when using the Zulip API bindings for some persistent jobs. We should ideally either enable a keep-alive, or perhaps a transparent retry for this class of connection error.

See zulip/zulip@ff647df for an example.

Activity

  1. Beanpen commented on Nov 10, 2022

    @Beanpen
    Collaborator

    @zulipbot claim

  2. zulipbot commented on Nov 10, 2022

    @zulipbot
    Member

    Welcome to Zulip, @Beanpen! We just sent you an invite to collaborate on this repository at https://github.com/zulip/python-zulip-api/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

    Here's some tips to get you off to a good start:

    As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

    See you on the other side (that is, the pull request side)!

  3. Beanpen commented on Nov 11, 2022

    @Beanpen
    Collaborator

    Hi @timabbott I wonder if you mean to remove all the alias of "client = zulip.Client(...)" and instead directly call "zulip.Client(...)" in all files. Thank you!

  4. zulipbot commented on Nov 21, 2022

    @zulipbot
    Member

    @Beanpen You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks!

  5. ryansong13 commented on Dec 6, 2022

    @ryansong13
    Collaborator

    @zulipbot claim

  6. zulipbot commented on Dec 6, 2022

    @zulipbot
    Member

    Welcome to Zulip, @ryansong13! We just sent you an invite to collaborate on this repository at https://github.com/zulip/python-zulip-api/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

    Here's some tips to get you off to a good start:

    As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

    See you on the other side (that is, the pull request side)!

  7. ryansong13 commented on Dec 13, 2022

    @ryansong13
    Collaborator

    @zulipbot abandon

  8. 45 remaining items

  9. zulipbot commented on Jul 29, 2026

    @zulipbot
    Member

    Welcome to Zulip, @HeetRanpura! By picking up a Zulip issue, you're promising to do your best to follow Zulip's contributing guidelines. Neglecting to do so wastes maintainer time, and may result in being banned from contributing to Zulip.

    To get started:

    1. Work through all the "Prior to picking up your first issue" sections of the Zulip contributor guide.
    2. Post a comment here describing your plan for how to approach this issue. Before you claim an issue, you should be confident that you will be able to tackle it effectively.
    3. Accept the invite to collaborate on this repository at https://github.com/zulip/python-zulip-api/invitations. To avoid filling your inbox, we recommend unwatching this repository.

    The issue will be assigned to you when all three steps have been completed. If you get stuck, you can always @zulipbot abandon this issue, and pick a different one.

    If someone else claims this issue while you're working through the checklist, no worries! You can contribute by providing feedback on their pull request. If you’ve made good progress in understanding part of the codebase, you can also find another “help wanted” issue in the same area to work on.

  10. HeetRanpura commented on Jul 29, 2026

    @HeetRanpura
    Collaborator

    @zulipbot
    Hi! Here's my plan for approaching this issue.
    I'll start by reproducing the issue locally and identifying the request path where an expired persistent connection causes the failure. From there, I'll trace how the exception is propagated through the client to understand where the current error handling can be improved.
    I'll also review the connection management and request logic to see how persistent sessions are established and reused, and compare the handling of this case with other network-related exceptions to keep the behavior consistent across the codebase.
    Once I understand the flow, I'll update the relevant error handling so that failures caused specifically by an expired persistent connection result in a clearer and more actionable exception, without affecting the handling of other request failures.
    Finally, I'll add or update tests to simulate this scenario, verify the expected exception and error message, run the relevant test suite to ensure there are no regressions, and submit a PR with the changes and any implementation notes if needed.

  11. added a commit that references this issue on Jul 31, 2026
    2287d04
  12. zulipbot commented on Aug 8, 2026

    @zulipbot
    Member

    @HeetRanpura You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks!

  13. HeetRanpura commented on Aug 8, 2026

    @HeetRanpura
    Collaborator

    @zulipbot Still active on this, PR #922 is up and ready for review.

  14. advikdivekar commented on Aug 11, 2026

    @advikdivekar

    @zulipbot abandon

  15. zulipbot commented on Aug 11, 2026

    @zulipbot
    Member

    ERROR: You have not claimed this issue to work on yet.

  16. nitikagotra75-crypto commented on Oct 6, 2026

    @nitikagotra75-crypto
    Collaborator

    @zulipbot claim

  17. zulipbot commented on Oct 6, 2026

    @zulipbot
    Member

    Welcome to Zulip, @nitikagotra75-crypto! By picking up a Zulip issue, you're promising to do your best to follow Zulip's contributing guidelines. Neglecting to do so wastes maintainer time, and may result in being banned from contributing to Zulip.

    To get started:

    1. Work through all the "Prior to picking up your first issue" sections of the Zulip contributor guide.
    2. Post a comment here describing your plan for how to approach this issue. Before you claim an issue, you should be confident that you will be able to tackle it effectively.
    3. Accept the invite to collaborate on this repository at https://github.com/zulip/python-zulip-api/invitations. To avoid filling your inbox, we recommend unwatching this repository.

    The issue will be assigned to you when all three steps have been completed. If you get stuck, you can always @zulipbot abandon this issue, and pick a different one.

    If someone else claims this issue while you're working through the checklist, no worries! You can contribute by providing feedback on their pull request. If you’ve made good progress in understanding part of the codebase, you can also find another “help wanted” issue in the same area to work on.

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions