{"action":"created","issue":{"url":"https://api.github.com/repos/uber/hyperbahn/issues/290","repository_url":"https://api.github.com/repos/uber/hyperbahn","labels_url":"https://api.github.com/repos/uber/hyperbahn/issues/290/labels{/name}","comments_url":"https://api.github.com/repos/uber/hyperbahn/issues/290/comments","events_url":"https://api.github.com/repos/uber/hyperbahn/issues/290/events","html_url":"https://github.com/uber/hyperbahn/issues/290","id":165177619,"number":290,"title":"For ad requests, max wait for relay-ad","user":{"login":"kriskowal","id":60294,"avatar_url":"https://avatars.githubusercontent.com/u/60294?v=3","gravatar_id":"","url":"https://api.github.com/users/kriskowal","html_url":"https://github.com/kriskowal","followers_url":"https://api.github.com/users/kriskowal/followers","following_url":"https://api.github.com/users/kriskowal/following{/other_user}","gists_url":"https://api.github.com/users/kriskowal/gists{/gist_id}","starred_url":"https://api.github.com/users/kriskowal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kriskowal/subscriptions","organizations_url":"https://api.github.com/users/kriskowal/orgs","repos_url":"https://api.github.com/users/kriskowal/repos","events_url":"https://api.github.com/users/kriskowal/events{/privacy}","received_events_url":"https://api.github.com/users/kriskowal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-12T20:50:49Z","updated_at":"2016-07-13T00:57:23Z","closed_at":null,"body":"Ad requests fan out a relay-ad request for each of k affine Hyperbahn relays for the advertiser. If any of those requests fail, typically due to a timeout, the ad response fails. As k increases, the probability of failure grows, and it is a frequent occurrence in production that failures cause \"storms\" of \"relay-ad\" requests, bogging down the network and effecting \"ad\" retries. \r\n\r\nTo mitigate this problem, let’s consider capping the amount of time an ad will wait for relay-ad responses, and always provide a successful response containing all of the relays that successfully responded, unless there were none, or there were too few (at discretion of assignee).\r\n\r\nI got started on this in my working copy, but it’s not even close to started. This just points where the code change probably ought to happen:\r\n\r\nhttps://github.com/uber/hyperbahn/compare/best-effort-ad\r\n\r\nThe logic should go like this: for about 200ms (out of the 500ms budget allotted to ad requests), we should wait for relay-ad responses. If all of the relays respond before the 200ms deadline, respond fast with the whole list. If the 200ms expires, respond immediately. Maybe if there are too few (arbitrary) responses, return an error, maybe forward the last error. Otherwise, return a success ad response with whatever relay-ad successes were obtained.\r\n\r\nUse timers.setTimeout instead of global setTimeout. We may need to use the time heap since we have a lot of timers, but if simple works in prod, the feature is done."},"comment":{"url":"https://api.github.com/repos/uber/hyperbahn/issues/comments/232225706","html_url":"https://github.com/uber/hyperbahn/issues/290#issuecomment-232225706","issue_url":"https://api.github.com/repos/uber/hyperbahn/issues/290","id":232225706,"user":{"login":"blampe","id":848843,"avatar_url":"https://avatars.githubusercontent.com/u/848843?v=3","gravatar_id":"","url":"https://api.github.com/users/blampe","html_url":"https://github.com/blampe","followers_url":"https://api.github.com/users/blampe/followers","following_url":"https://api.github.com/users/blampe/following{/other_user}","gists_url":"https://api.github.com/users/blampe/gists{/gist_id}","starred_url":"https://api.github.com/users/blampe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blampe/subscriptions","organizations_url":"https://api.github.com/users/blampe/orgs","repos_url":"https://api.github.com/users/blampe/repos","events_url":"https://api.github.com/users/blampe/events{/privacy}","received_events_url":"https://api.github.com/users/blampe/received_events","type":"User","site_admin":false},"created_at":"2016-07-13T00:57:23Z","updated_at":"2016-07-13T00:57:23Z","body":"cc @jeffbean "}}
{"actor":{"display_login":"blampe"}}