{"action":"closed","issue":{"url":"https://api.github.com/repos/Metaswitch/chronos/issues/312","repository_url":"https://api.github.com/repos/Metaswitch/chronos","labels_url":"https://api.github.com/repos/Metaswitch/chronos/issues/312/labels{/name}","comments_url":"https://api.github.com/repos/Metaswitch/chronos/issues/312/comments","events_url":"https://api.github.com/repos/Metaswitch/chronos/issues/312/events","html_url":"https://github.com/Metaswitch/chronos/issues/312","id":188535686,"number":312,"title":"Chronos callback treats HTTP failure responses as OK","user":{"login":"johadalin","id":14074163,"avatar_url":"https://avatars.githubusercontent.com/u/14074163?v=3","gravatar_id":"","url":"https://api.github.com/users/johadalin","html_url":"https://github.com/johadalin","followers_url":"https://api.github.com/users/johadalin/followers","following_url":"https://api.github.com/users/johadalin/following{/other_user}","gists_url":"https://api.github.com/users/johadalin/gists{/gist_id}","starred_url":"https://api.github.com/users/johadalin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johadalin/subscriptions","organizations_url":"https://api.github.com/users/johadalin/orgs","repos_url":"https://api.github.com/users/johadalin/repos","events_url":"https://api.github.com/users/johadalin/events{/privacy}","received_events_url":"https://api.github.com/users/johadalin/received_events","type":"User","site_admin":false},"labels":[{"id":78005403,"url":"https://api.github.com/repos/Metaswitch/chronos/labels/bug","name":"bug","color":"fc2929","default":true},{"id":178681623,"url":"https://api.github.com/repos/Metaswitch/chronos/labels/cat:easy","name":"cat:easy","color":"bfdadc","default":false},{"id":107528433,"url":"https://api.github.com/repos/Metaswitch/chronos/labels/medium-priority","name":"medium-priority","color":"eb6420","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-10T15:20:05Z","updated_at":"2016-11-24T14:25:37Z","closed_at":"2016-11-24T14:25:37Z","body":"In testing https://github.com/Metaswitch/sprout/pull/1587, where sprout was made to respond 503 to all http requests, it was noticed that the subscription and registration timeout live-tests were failing.\r\n\r\nThis was due to the chronos timer pop receiving a 503 response, where sprout rejects the timer, but chronos notes that the callback was successful.\r\nThe check responsible for this is at  https://github.com/Metaswitch/chronos/blob/dev/src/http_callback.cpp#L139 \r\nMore properly, we should not treat _any_ http response as a success, but should be aware of the different http errors, and handle them reasonably; the sprout handlers appear to assume that chronos is already able to do this, in that it sends different responses for different types of request failure, at https://github.com/Metaswitch/sprout/blob/dev/src/handlers.cpp#L199\r\n\r\n\r\nOne reasonable way to go about reseolving this is to simply implement awareness of these errors in the http_callback methods, setting the curl option [CURLOPT_FAILONERROR](https://curl.haxx.se/libcurl/c/CURLOPT_FAILONERROR.html), which would lead to failures being raised, and then handled in https://github.com/Metaswitch/chronos/blob/dev/src/http_callback.cpp#L147\r\n"}}
{"actor":{"display_login":"sebrexmetaswitch"}}