[PATCH] prepare for a user-configurable RHEV-image-import timeout

Jim Meyering jim at meyering.net
Mon Oct 3 20:08:53 UTC 2011


Pete Zaitcev wrote:

> On Mon, 03 Oct 2011 12:15:57 +0200
> Jim Meyering <jim at meyering.net> wrote:
>
> (with Richard and Ian on cc:)
>
>> >> The current timeout of 10 minutes is too short for some users,
>> >> and what they need (60 minutes) seems like it would be far too
>> >> long for most others to wait for notification of failure.
>
>> * backend.c (fs_rhevm_register): Use import-timeout, if specified.
>
>> +++ b/backend.c
>> @@ -1548,11 +1552,28 @@ fs_rhevm_register (my_state *ms, const provider_t *prov, const char *next,
>>  	if (!cluster)
>>  		cluster = "_none_";
>>
>> +	char *import_timeout_str = kv_hash_lookup (args, "import-timeout");
>> +	time_t import_timeout_seconds = 0;
>> +	if (import_timeout_str) {
>> +		unsigned long timeout_tmp;
>> +		if (xstrtoul (import_timeout_str, NULL, 10,
>> +			      &timeout_tmp, NULL) != LONGINT_OK
>
>> +++ b/doc/registrations.md
>> @@ -118,6 +118,7 @@ Registration call:
>>    -d nfs-host=fish.usersys.redhat.com \
>>    -d nfs-path=/home/vdsm/v1 \
>>    -d nfs-dir=/mnt/iwhd-fish \
>> +  -d import-timeout=3600 \
>>    -d cluster=_any_ \
>>    http://localhost:9090/buk1/dummy_img
>
> Jim, I have reservations about this way of passing the parameter.
> From the code beauty standpoint, it is certainly better than putting
> it into the provider configuration, because you keep them all in
> the same place. This is why I did not even document how to specify
> api-key and friends in /etc/iwhd/conf.js. However, Richard has no way
> to specify an additional POST argument (AFAIK, Ian did not leave
> a universal way to pass random POST parameters). Therefore, he would
> be unable to use the patch above. Perhaps it is better to have the
> import-timeout in conf.js after all, where it can be set without code
> changes in the factory, even though it's ugly.
>
> Everything else about the patch looks good.

Hi Pete,
Thanks for the feedback.  That makes sense.
I'll add an optional timeout parameter to the config file.


More information about the iwhd-devel mailing list