def get_page(self): server = get_server(self, 'normal') self.application.http_client_factory.register_upstream( 'no_available_backend', {}, [server]) server.is_active = False def check_requests_cb(): check_all_requests_done(self, 'no_available_backend') async_group = AsyncGroup(check_requests_cb) def callback_post(text, response): if response.error and response.code == 502: self.text = 'no backend available' return self.text = text self.post_url('no_available_backend', self.request.path, callback=async_group.add(callback_post)) check_all_requests_done(self, 'no_available_backend')
def check_requests_cb(): check_all_requests_done(self, 'no_retry_timeout')
def check_requests_cb(): check_all_requests_done(self, 'no_available_backend')
def check_requests_cb(): check_all_requests_done(self, 'retry_non_idempotent_503') check_all_requests_done(self, 'do_not_retry_non_idempotent_503')
def check_requests_cb(): check_all_requests_done(self, 'no_retry_error')
def check_requests_cb(): check_all_requests_done(self, 'retry_on_timeout')
def check_requests_cb(): check_all_requests_done(self, 'retry_connect')
def check_server_active(): if server.is_active: self.text += ' activated' check_all_requests_done(self, 'deactivate')