-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Lock] DynamoDB store #60138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 7.3
Are you sure you want to change the base?
[Lock] DynamoDB store #60138
Conversation
This comment has been minimized.
This comment has been minimized.
this new store should probably in a bridge package, so that we can manage its dependency properly. |
@stof Thank you for your feedback, I did move it to its own bridge, I'm not sure if I've done everything required from a structural POV. I still didn't touch the tests yet |
While I agree on that @stof, right now there is no Bridge namespace: |
@OskarStark this does not prevent us from adding it if we need it. |
@stof @OskarStark thank you for taking the time to review this 😄 I've actually updated the PR to add this Bridge namespace following the structure from the Messenger SQS example, but the package validation is failing and I'm unsure why as I've placed the composer.json file exactly in the same level as the Messenger SQS one, trying to investigate that right now |
Yay! Package checks are passing, the match case for |
Yes, we need to keep in mind, that we need to configure a proper split for the repo etc. |
src/Symfony/Component/Lock/Bridge/DynamoDb/Store/DynamoDbStore.php
Outdated
Show resolved
Hide resolved
…ult of async-aws client
The current state of this is:
I have re-requested your reviews, thank you 😄 |
src/Symfony/Component/Lock/Bridge/DynamoDb/Tests/Functional/Store/AbstractStoreTestCase.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few more adjustments for this new package, and it looks good to me. I haven't read over the implementation in detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM.
Just a line of code that can be removed.
src/Symfony/Component/Lock/Bridge/DynamoDb/Store/DynamoDbStore.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Lock/Bridge/DynamoDb/Store/DynamoDbStore.php
Outdated
Show resolved
Hide resolved
if ('default' !== ($params['host'] ?? 'default')) { | ||
$clientConfiguration['endpoint'] = \sprintf('%s://%s%s', ($options['sslmode'] ?? null) === 'disable' ? 'http' : 'https', $params['host'], ($params['port'] ?? null) ? ':'.$params['port'] : ''); | ||
if (preg_match(';^dynamodb\.([^\.]++)\.amazonaws\.com$;', $params['host'], $matches)) { | ||
$clientConfiguration['region'] = $matches[1]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where this code is tested. Can you add a test case with a custom host?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR introduces a new Lock store using AWS DynamoDb. The idea is coming from this article.
The implementation is heavily based on: