Skip to content

Commit 5b3470c

Browse files
committed
Retry on all failed requests.
1 parent ee8abea commit 5b3470c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

newrelic/core/agent_protocol.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
DiscardDataForRequest,
2828
ForceAgentDisconnect,
2929
ForceAgentRestart,
30+
NetworkInterfaceException,
3031
RetryDataForRequest,
3132
)
3233

@@ -202,9 +203,15 @@ def close_connection(self):
202203

203204
def send(self, method, payload=()):
204205
params, headers, payload = self._to_http(method, payload)
205-
response = self.client.send_request(
206-
params=params, headers=headers, payload=payload
207-
)
206+
207+
try:
208+
response = self.client.send_request(
209+
params=params, headers=headers, payload=payload
210+
)
211+
except NetworkInterfaceException:
212+
# All HTTP errors are currently retried
213+
raise RetryDataForRequest
214+
208215
status, data = response
209216

210217
if not 200 <= status < 300:

0 commit comments

Comments
 (0)