Skip to content

Commit bd2f17b

Browse files
authored
prepare 6.2.0 release (#93)
1 parent 3577b61 commit bd2f17b

File tree

7 files changed

+31
-4
lines changed

7 files changed

+31
-4
lines changed

.circleci/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ workflows:
88
- test-3.4
99
- test-3.5
1010
- test-3.6
11+
- test-3.7
1112
test-template: &test-template
1213
steps:
1314
- checkout
@@ -59,3 +60,8 @@ jobs:
5960
docker:
6061
- image: circleci/python:3.6-jessie
6162
- image: redis
63+
test-3.7:
64+
<<: *test-template
65+
docker:
66+
- image: circleci/python:3.7-stretch
67+
- image: redis

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to the LaunchDarkly Python SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
44

5+
## [6.2.0] - 2018-08-03
6+
### Changed:
7+
- In streaming mode, each connection failure or unsuccessful reconnection attempt logs a message at `ERROR` level. Previously, this message included the amount of time before the next retry; since that interval is different for each attempt, that meant the `ERROR`-level messages were all unique, which could cause problems for monitors. This has been changed so the `ERROR`-level message is always the same, and is followed by an `INFO`-level message about the time delay. (Note that in order to suppress the default message, the LaunchDarkly client modifies the logger used by the `backoff` package; if you are using `backoff` for some other purpose and _do_ want to see the default message, set `logging.getLogger('backoff').propagate` to `True`.) ([#88](https://github.com/launchdarkly/python-client/issues/88))
8+
59
## [6.1.1] - 2018-06-19
610

711
### Fixed:

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @ashanbrown
1+

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ LaunchDarkly SDK for Python
1010

1111
[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)
1212

13+
Supported Python versions
14+
-------------------------
15+
16+
This version of the LaunchDarkly SDK is compatible with Python 2.7, and Python 3.3 through 3.7.
17+
1318
Quick setup
1419
-----------
1520

ldclient/streaming.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from threading import Thread
66

77
import backoff
8+
import logging
89
import time
910

1011
from ldclient.interfaces import UpdateProcessor
@@ -32,6 +33,13 @@ def __init__(self, config, requester, store, ready):
3233
self._running = False
3334
self._ready = ready
3435

36+
# We need to suppress the default logging behavior of the backoff package, because
37+
# it logs messages at ERROR level with variable content (the delay time) which will
38+
# prevent monitors from coalescing multiple messages. The backoff package attempts
39+
# to suppress its own output by default by giving the logger a NullHandler, but it
40+
# will still propagate up to the root logger unless we do this:
41+
logging.getLogger('backoff').propagate = False
42+
3543
# Retry/backoff logic:
3644
# Upon any error establishing the stream connection we retry with backoff + jitter.
3745
# Upon any error processing the results of the stream we reconnect after one second.
@@ -65,8 +73,12 @@ def _backoff_expo():
6573
def should_not_retry(e):
6674
return isinstance(e, UnsuccessfulResponseException) and (not is_http_error_recoverable(e.status))
6775

76+
def log_backoff_message(props):
77+
log.error("Streaming connection failed, will attempt to restart")
78+
log.info("Will reconnect after delay of %fs", props['wait'])
79+
6880
@backoff.on_exception(_backoff_expo, BaseException, max_tries=None, jitter=backoff.full_jitter,
69-
giveup=should_not_retry)
81+
on_backoff=log_backoff_message, giveup=should_not_retry)
7082
def _connect(self):
7183
return SSEClient(
7284
self._uri,

ldclient/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "6.1.1"
1+
VERSION = "6.2.0"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def parse_requirements(filename):
1313
return [line for line in lineiter if line and not line.startswith("#")]
1414

1515

16-
ldclient_version='6.1.1'
16+
ldclient_version='6.2.0'
1717

1818
# parse_requirements() returns generator of pip.req.InstallRequirement objects
1919
install_reqs = parse_requirements('requirements.txt')

0 commit comments

Comments
 (0)