---
source_url: https://www.pubnub.com/docs/sdks/python/reconnection-policies
title: Reconnection Policies for Python SDK
updated_at: 2026-06-26T11:06:43.502Z
sdk_name: PubNub Python SDK
sdk_version: 10.7.1
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Reconnection Policies for Python SDK

PubNub Python SDK, use the latest version: 10.7.1

Install:

```bash
pip install pubnub@10.7.1
```

In networked applications, maintaining a stable connection is critical. The PubNub Python Software Development Kit (SDK) provides three reconnection policies to help applications recover from temporary network disruptions.

:::note Default behavior
Default behavior: If you do not set a reconnection policy, `PNReconnectionPolicy.EXPONENTIAL` is used.
:::

### Types of reconnection policies

Choose the policy that best matches your environment and tolerance for retry delays during a network or internet issue.

* PNReconnectionPolicy.NONE: The SDK does not attempt automatic reconnection when there is a network or internet issue. Use when: You need full control over retry logic or want to fail fast in short‑lived scripts and serverless functions.
* PNReconnectionPolicy.LINEAR: The SDK attempts to reconnect at a fixed interval until connectivity is restored. Use reconnection_interval to set the delay in seconds. If not set, the SDK defaults to 2 seconds plus a random sub-second jitter. Use maximum_reconnection_retries to limit the number of attempts; if not set, the policy default of 10 applies. Use when: You prefer consistent retry intervals in stable networks where brief outages are expected.
* PNReconnectionPolicy.EXPONENTIAL (default): The SDK uses the Exponential Backoff algorithm to increase the delay between reconnection attempts progressively. Use maximum_reconnection_interval to cap the backoff delay; if not set, the SDK defaults to a maximum of 150 seconds. Use maximum_reconnection_retries to limit the number of attempts; if not set, the policy default of 6 applies. Use when: You want to reduce load on unstable networks or downstream services by spacing out retries.

:::warning Set retry limits explicitly
The Python SDK doesn't enforce upper bounds on `maximum_reconnection_retries` or `maximum_reconnection_interval`.
Without limits, misconfigured policies may cause excess network traffic, battery drain, or usage spikes. Always choose values suited to your app.
:::