pykafka
pykafka copied to clipboard
Socket reconnection on retries of JoinGroup, SyncGroup, LeaveGroup
Today, if JoinGroup sees a socket disconnection, it will retry again without reconnecting the connection which results in subsequent retries all to fail.
This change will ensure that we attempt to reconnect the connection if see a disconnected connection while selecting a unique RequestHandler to use for this request.
Alternative approaches that can be considered:
- Reconnect automatically in
RequestHandler.requestbefore callingself.shared.requests.put - Reconnect automatically in
BrokerConnection.requestif required
Codecov Report
Merging #939 into master will increase coverage by
0.09%. The diff coverage is66.66%.
@@ Coverage Diff @@
## master #939 +/- ##
==========================================
+ Coverage 83.32% 83.41% +0.09%
==========================================
Files 36 36
Lines 3807 3811 +4
Branches 562 563 +1
==========================================
+ Hits 3172 3179 +7
+ Misses 489 486 -3
Partials 146 146
| Impacted Files | Coverage Δ | |
|---|---|---|
| pykafka/managedbalancedconsumer.py | 84.1% <100%> (ø) |
:arrow_up: |
| pykafka/broker.py | 88.13% <60%> (-5.51%) |
:arrow_down: |
| pykafka/connection.py | 83.16% <0%> (-1.99%) |
:arrow_down: |
| pykafka/topic.py | 80.41% <0%> (-1.04%) |
:arrow_down: |
| pykafka/balancedconsumer.py | 91.22% <0%> (+1.16%) |
:arrow_up: |
| pykafka/simpleconsumer.py | 86.6% <0%> (+1.56%) |
:arrow_up: |
| pykafka/cluster.py | 71.89% <0%> (+1.82%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 6599354...238bcc8. Read the comment docs.
Thanks for the contribution. I think your first alternate suggestion of putting this functionality in RequestHandler might be a better way to maintain encapsulation.