segmentio / analytics-python

The hassle-free way to integrate analytics into any python application.
https://segment.com/libraries/python
MIT License
240 stars 149 forks source link

sync_mode=True does not utilize max_retries param #210

Closed emfloyd2 closed 2 years ago

emfloyd2 commented 2 years ago

Howdy. I wasn't sure if this is intentional, so I started with an Issue report.

It appears sync mode does not utilize retries (and backoff lib).

For reference: https://github.com/segmentio/analytics-python/blob/master/segment/analytics/consumer.py#L125-L134

versus sync implementation: https://github.com/segmentio/analytics-python/blob/master/segment/analytics/client.py#L280-L285

nd4p90x commented 2 years ago

@emfloyd2 Thank you for your inquiry. After doing some research I found that you are correct and it is by design.

In the Python LIB there is an experimental feature called "sync_mode", sync_mode does NOT queue or batch messages, it sends them right away, synchronously. This would also negate the retry and backoff feature.

jplindstrom commented 1 year ago

This would also negate the retry and backoff feature.

Can you clarify how the lack of retries is an intentional feature when using sync mode?

There is already a way to disable retries if you would want that, which is to set:

sync_mode=True,
max_retries=0,