analytics-android
analytics-android copied to clipboard
No flush backoff
DEFAULT_FLUSH_INTERVAL is set to 30s. This is fine for normal network conditions, if somewhat careless with battery usage.
However, under abnormal network conditions and inside an app with a foreground service, the lack of back-off behaviour results in significant wasted modem on time.
This is easily tested by running a DNS blackhole for api.segment.io (return NXDOMAIN, or cause any non-4xx error to be thrown). Instead of slowing requests, Segment wakes up the modem every 30 seconds.
Since there's no back-off functionality available to an SDK consumer, the default interval could probably be increased. This is especially true if the upload exception is caused by network connectivity.
@somehibs correct. we faced this issue. where we were using our server and server went down, when it came up we received swarm of network hits from segment.