diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2018-03-14 17:22:18 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2018-03-14 23:21:26 +0200 |
commit | 649a04b9deec5d111e735bc47c37adca7e76f39e (patch) | |
tree | c651192f145575fc7a49d591738f9cfc6e80e6d8 /src/eclat.h | |
parent | ae194ce922bff039e9003f1e84d44132aab63c3e (diff) | |
download | eclat-649a04b9deec5d111e735bc47c37adca7e76f39e.tar.gz eclat-649a04b9deec5d111e735bc47c37adca7e76f39e.tar.bz2 |
Implement exponential backoff with jitter to handle RequestLimitExceeded
* src/eclat.h (eclat_command_env) <curl>: Remove.
<xmltree>: New field.
* src/util.c (translate_ids): Close the map when no longer needed
(eclat_send_request): Implement exponential backoff.
* src/ec2map.c: Reflect the above changes.
* src/eclat.c: Likewise.
* lib/libeclat.h (eclat_request_dup): New proto.
* lib/reqcreat.c (eclat_request_dup): New function.
* src/config.c: New configuration statements: max-retry-interval and
retry-timeout.
Diffstat (limited to 'src/eclat.h')
-rw-r--r-- | src/eclat.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/eclat.h b/src/eclat.h index 5a067f4..221347f 100644 --- a/src/eclat.h +++ b/src/eclat.h @@ -1,5 +1,5 @@ /* This file is part of Eclat. - Copyright (C) 2012-2015 Sergey Poznyakoff. + Copyright (C) 2012-2018 Sergey Poznyakoff. Eclat is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -70,6 +70,8 @@ extern char *instance_store_base_url; extern unsigned short instance_store_port; extern char *instance_store_document_path; extern char *instance_store_credentials_path; +extern unsigned long max_retry_sleep; +extern unsigned long max_retry_time; typedef int (*config_finish_hook_t) (void*); @@ -82,8 +84,8 @@ int run_config_finish_hooks(void); struct eclat_command_env { struct eclat_command const *cmd; - CURL *curl; struct ec2_request *request; + struct grecs_node *xmltree; }; typedef struct eclat_command_env eclat_command_env_t; @@ -221,7 +223,7 @@ void describe_request_create(eclat_command_env_t *env, int argc, char **argv, void describe_request_update(eclat_command_env_t *env, int argc, char **argv, const char *uparm, int n_in, int *n_out); -int eclat_send_request(CURL *curl, struct ec2_request *q); +int eclat_send_request(struct ec2_request *q, struct grecs_node **ret); char *eclat_get_instance_zone(void); void eclat_get_instance_creds(char *id, char **access_key_ptr, char **secret_key_ptr, |