humanmade / aws-xray

HM Platform AWS X-Ray Integration
23 stars 4 forks source link

Fix length of socket_sendto #26

Closed joehoyle closed 5 years ago

joehoyle commented 5 years ago

A double sided issue: we had the limit way too low for max size of segments. This was set to 1KB and should have been 64. This is causing way more segments to be send intedepently to the UPD daemon than needed.

Also, we have another issue (#14) where large segments are causing errors. As it happens, this I think is being caused by single large segments, not a large tree of segments that could be split up. This is what I added a unit test case for, to make sure large segments are correctly split up.

I think the errors we are seeing around too large messages over UDP is due to very large single segments, almost definitly the start / end segments. These include a lot of data. All the super globels, and on the end segment, all errors from the request. AWS doesn't provide a way to do further delta / chunking beyond the segment level, so we are kinda stuck there. We could fallback to sending less data (say somehow don't send superglobals or errors if they make it too long) but we are getting into a bit of whackamole there.

I atleast updated the code to log properly when this error happens, and it will also log the UPD message so we'll know for sure what specifically is causing those errors.

joehoyle commented 5 years ago

@nathanielks you keep me honest!

nathanielks commented 5 years ago

⚖️ Checks and balances, my friend 😁