When issuing many simultaneous requests to Synaptic Atmos I observed:
HTTP/1.1 failed with code 500, error: AtmosError
[code=1040, message=The server is busy. Please try again.]
Previously all clients slept for fixed intervals and thus retried
around the same time. This commit adds a random delay which should
better distribute load on the provider.
To repro issue 342, the following steps were taken:
- Spawn 500 parallel / 2000 total putBlobs to cloudfiles-uk
- issue a SIGSTOP
- wait 60 seconds
- issue a SIGCONT
Without this patch, there are several hundred 408s.
With this patch, these are retried and complete successfully.
Previously jclouds could use an unlimited number of threads on its
user ExecutorService. While this ExecutorService will go away when we
complete deasyncafication, we should prevent jclouds from misbehaving
until that time.
FileBackedOutputStream.asByteSource.getInput returns a FileInputStream
which we do not close. We later call FileBackedOutputStream.reset
which removes the underlying File. This fails on Windows which does
not support deleting an open file and leaks resources on other
platforms. Eagerly close to address this issue.
- Adds networks field/methods to TemplateOptions.
- Adds them to children as well for legacy reasons.
- Deprecates CloudStackTemplateOptions#networkIds methods in favor of #networks.
- TODO: Modify compute abstraction layer for provisioning for nova,
EC2, et al to take advantage of this.
Consuming the result of deleteContainerIfEmpty avoids an eventual
issue with Swift containers. Also backfill some tests for
deleteContainerIfEmpty. Fixes JCLOUDS-420.
Payload.getInput must always call openStream to handle overridden
methods correctly. Previously this caused errors in jclouds-chef in
BaseCipherPayload.
Callers should instead call BlobBuilder.contentMD5, usually with the
results from Guava Hashing.md5(). This narrows the API and removes a
strange IOException from callers.
Also deprecate byte[], File, InputSupplier<InputStream>, and String
Payloads. Callers should instead provide a ByteSource via
ByteSource.wrap(byte[]) and Files.asByteSource(File)
We plan to transition Payload to ByteSource in the next major release.
Unfortunately Payload.getInput masks its checked exception and
ByteSource.getInput is final so we cannot continue to mask the
exceptions. Deprecation of getInput and addition openStream allows us
to transition callers from the former to the latter.