Fix DynamoDB session handler sleep time#1122
Merged
Merged
Conversation
Between attempts to access a locked session, the handler is meant to wait for a configurable number of microseconds. The handler code was previously multiplying the wait time by 10^-6 before passing it to usleep, even though the values were already in microseconds. For the default min and max wait time values of 10000 and 50000, the usleep argument would always be less than one and so the handler wouldn't wait at all between attempts. This commit removes the multiplication by 10^-6, so the handler sleeps for the intended amount of time between requests.
Contributor
Contributor
|
Doh! 😦 Nice catch @pspiller |
visdesk
added a commit
to visdesk/aws-sdk-php
that referenced
this pull request
Mar 27, 2017
* Fix CI Warning caused by PHPUnit Api deprecation (aws#1037) * When PHP Fatal Error is not surfaced, disable retry on certain errors (aws#1053) * When PHP Fatal Error is not surfaced, disable retry on certain errors * add error class check * use Throwable * update models for next release * 3.18.34 release * Update doc * update models for next release * 3.18.35 release * Disable autoload when checking class existence (aws#1056) * Disable autoload when checking class existence * remove unnecessary check * update models for next release * 3.18.36 release * update models for next release * 3.18.37 release * update models for next release * 3.18.38 release * Added the DynamoDB Marshaler argument mapAsObject to unmarshalItem method (aws#1067) * [Doc-Only]Add Error code handling documentation and split project information (aws#1062) * Add Error code handling documentation and split project information * Add standalone feature * fix upcase * Adding support for S3 IPv6 (aws#1068) * Add support for dual stack endpoint * enhance test, remove parameter check * Path style host * update models for next release * 3.18.39 release * update models for next release * 3.19.0 release * Fix ElasticLoadBalancingV2 endpoints resolving issue (aws#1072) * Fix ElasticLoadBalancingV2 endpoints resolving issue * move to constructor * Fix documentation * update models for next release * 3.19.1 release * update models for next release * 3.19.2 release * Update model for next release * 3.19.3 release * update models for next release * 3.19.4 release * 3.19.5 release * update models for next release * 3.19.6 release * update models for next release * 3.19.7 release * 3.19.8 release * Removed undefined namespace (aws#1087) * update models for next release * 3.19.9 release * update models for next release * 3.19.10 release * Properly set security token for upload (aws#1093) * Adding a rejected promise handler to determineBucketRegionAsync (aws#1075) * Adding a rejected promise handler to determineBucketRegionAsync * add another test case * update models for next release * 3.19.11 release * update models for next release * 3.19.12 release * Fix duplicate EC2 in Doc quicklink (aws#1095) * update models for next release * 3.19.13 release * Add support for s3-accelerate.dualstack Endpoint (aws#1103) * Adding support for s3-accelerate.dualstack endpoint * Add S3EndpointMiddleware instead * Add pattern const with number & renaming * fix indentation * update models for next release * 3.19.13 release * fix tag * 3.19.14 release * update model for next release * 3.19.15 release * update model for next release * 3.19.16 release * update model for next release * 3.19.17 release * update model for next release * 3.19.18 release * removesdb in endpoint * update model for next release * 3.19.19 release * update model for next release * 3.19.20 release * update model for next release * 3.19.21 release * Remove (optional) in documentation (aws#1108) * update model for next release * 3.19.22 release * update model for next release * 3.19.23 release * 3.19.24 release * update model for next release * 3.19.25 release * update model for next release * 3.19.26 release * update model for next release * 3.19.27 release * update model for next release * 3.19.28 release * update model for next release * 3.19.29 release * update model for next release * 3.19.30 release * update model for next release * 3.19.31 release * Fix PHPUnit Mock object failing (5.6, 7.0) (aws#1123) * Fix PHPUnit Mock object failing (5.6, 7.0) * Remove mock * clean up * update model for next release * 3.19.32 release * Fix DynamoDB session handler sleep time (aws#1122) Between attempts to access a locked session, the handler is meant to wait for a configurable number of microseconds. The handler code was previously multiplying the wait time by 10^-6 before passing it to usleep, even though the values were already in microseconds. For the default min and max wait time values of 10000 and 50000, the usleep argument would always be less than one and so the handler wouldn't wait at all between attempts. This commit removes the multiplication by 10^-6, so the handler sleeps for the intended amount of time between requests. * Fix ECS credential throws exception outside of a RejectedPromise (aws#1126) * change us-standard to us-east-1 (aws#1127) * update model for next release * 3.19.33 release * update model for next release * 3.20.0 release * update model for next release * 3.20.1 release * Fix PostObjectV4 ignoring customized virtual-style endpoint (aws#1131) * Fix PostObjectV4 ignoring customized virtual-style endpoint * checking using prefix * test bucket contains dot * fix prefix * update model for next release * 3.20.2 release * update model for next release * 3.20.3 release * update model for next release * 3.20.4 release * Add remote credentials provider (aws#1133) * Add remote credentials provider * Always chain instance profile in default credential provider * Fix tests * Add Doc cross linking support (aws#1139) * Add doc cross linking support, generating rewrite file * fix html * fix name * update model for next release * 3.20.5 release * Blacklist 'x-amzn-trace-id' header (aws#1141) * update model for next release * 3.20.6 release * update model for next release * 3.20.7 release * Adding new release changes * 3.20.8 release * 3.20.9 release * Update CHANGELOG.md * Update CHANGELOG.md * 3.20.10 release * 3.20.11 release * Update CHANGELOG.md * 3.20.12 release * Fixed typo (aws#1147) * 3.20.13 release * Fix sed to work on GNU ``` sed -i '' -e "s/VERSION = '.*'/VERSION = '3.20.15'/" src/Sdk.php ``` The above command would fail on GNU. The update works fine on both GNU and OSX 10.9+ Reference: - http://www.grymoire.com/Unix/Sed.html#uh-62h - http://stackoverflow.com/questions/4247068/sed-command-with-i-option-failing-on-mac-but-works-on-linux * 3.20.14 release * 3.20.14 release * 3.20.15 release * Fix manifest * Update Changelog * 3.20.16 release * Fix AWS Documentation files * Update Example Json * Adds support for AssumeRole and ./aws/config ini credentials (aws#1137) * Add shared config * fix php5.5 * Camel case, renaming, formatting fix etc. * Add AssumeRoleResolver * seperate from default chain, and documentation and small fix etc. * clean up * rebase pre * fix typo * Add support for assume role profile and ./aws/config * Fix doc * fix format * Remove trait file * fix indent * Add doc * Fix indent * require client parameter * Fix documentation * Fix exception * Skip invalid example snippets instead of break the doc * clean up * update model for next release * 3.21.0 release * update models for release * 3.21.1 release * update model for release * 3.21.2 release * update models for release * 3.21.3 release * Update models for release * 3.21.4 release * Update models for release * 3.21.5 release * Link docs for S3ClientTrait methods to the S3ClientInterface methods they implement * Update models for release * 3.21.6 release * Update Readme Update Readme.md with instructions on getting help and opening issues * Update README.md * Delete copy-model.sh * Update models for release * 3.22.0 release * Fixed typo in docblock comment * Update models for release * 3.22.1 release * Update models for release * 3.22.2 release * Fix Marshaler leaving dangling references (aws#1168) Some PHP versions will create references to keys instead of copying them after doing a foreach-by-reference, which can cause unexpected state mutations. Remove those foreach-by-reference calls to prevent that from happening * Update models for release * 3.22.3 release * Update models for release * 3.22.4 release * Update models for release * 3.22.5 release * Automate changelog (aws#1169) * Script to automate Release Automation * Update comments * add method to fix endpoints files * Fix code formatting and add unit tests * Fix code formatting and add unit tests * Fix unit tests and indentation * Fix tests formatting and code fix * Remove Newline * Fix indentation and typos * PSR2 compatible code and code fix * Fix call for object instantiation * Fix endpoints file indentation * Update resources json * Update unit tests * Update class and test file * Remove extra newlines from code * rename verbose flag * update main class and builder class * remove unused var * update class and builder * made changes * Fixes aws#1181 (aws#1182) * fix typo * Update models for release * 3.22.6 release * Update models for release * 3.22.7 release * Fix retry jitter logic (aws#1187) * Add filePath Info in MultipartUploadException (aws#1140) * Add $filePath Info in MultipartUploadException * Pass endpoint prefix rather than service identifier to EndpointProvider (aws#1192) * Ignore isRegionalized if no partitionEndpoint is provided * Do not patch SDB signatureVersions -- they are unresolvable by the PartitionEndpointProvider, which should return `null` * Pass endpoint prefix rather than service identifier to the EndpointProvider * Remove constructor customization from ELBv2 client * Update models for release * 3.22.8 release * Move idempotency token generation from EC2 and SSM customizations to ClientResolver * Allow serialization of XML structure with name but no locationName * Sync protocol tests * Update models for release * 3.22.9 release * Update models for release * 3.22.10 release * Prefer the signing name provided by the service model to that provided by the endpoint provider * Update models for release * 3.22.11 release * Update models for release * 3.23.0 release * Update models for release * 3.23.1 release * Update version constraint on guzzlehttp/psr7 to allow 1.4.1 * Add unsigned Payload capability * add tests for unsigned signature v4 * Update models for release * 3.23.2 release * Update code and add more tests * remove variable from s3signv4 * Fix minore typos * Update code and remove typos * Update models for release * 3.23.3 release * Update models for release * 3.24.0 release * Update models for release * 3.24.1 release * Update models for release * 3.24.2 release * change null comparison to not empty * Force usage of the latest version of guzzlehttp/psr7 due to BC concerns * Update models for release * 3.24.3 release * Update code and add unit tests for Invalid Security Token when using Access/Secret key from environment: * Update models for release * 3.24.4 release * Bug Fix * created CloudWatch example section and added section on creating alarms * Add tests and update code * Update code * Fix formatting * changing topic title and filename * update code and fix formatting * update test and unsign payload only for https requests * Add more tests and update code * Update models for release * 3.24.5 release * Update models for release * 3.24.6 release * Update models for release * 3.24.7 release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Between attempts to access a locked session, the handler is meant to
wait for a configurable number of microseconds. The handler code was
previously multiplying the wait time by 10^-6 before passing it to
usleep, even though the values were already in microseconds. For the
default min and max wait time values of 10000 and 50000, the usleep
argument would always be less than one and so the handler wouldn't
wait at all between attempts.
This commit removes the multiplication by 10^-6, so the handler sleeps
for the intended amount of time between requests.