Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Lock] Refine the contract and implementation for Stores to handle Not Expirable Store cases.#28727

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@GaneshChandrasekaran-zz
Copy link
Contributor

@GaneshChandrasekaran-zzGaneshChandrasekaran-zz commentedOct 4, 2018
edited
Loading

The Stores contract and implementation doesn't clearly distinguish between stores that support expirable stores and ones which don't. This change attempts to improve that for better usage of the functions by the services without running into runtime issues.

QA
Branch?master
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#28696
LicenseMIT
Doc PRn/a

@GaneshChandrasekaran-zzGaneshChandrasekaran-zzforce-pushed thegchandrasekaran_fixPutOffExpirationForZookeeperStore branch 2 times, most recently from61aca8c tod8e4de3CompareOctober 4, 2018 15:02
@GaneshChandrasekaran-zzGaneshChandrasekaran-zzforce-pushed thegchandrasekaran_fixPutOffExpirationForZookeeperStore branch fromd8e4de3 to5a0cad2CompareOctober 4, 2018 15:11
@GaneshChandrasekaran-zzGaneshChandrasekaran-zzforce-pushed thegchandrasekaran_fixPutOffExpirationForZookeeperStore branch 3 times, most recently froma5b504b to07457f3CompareOctober 4, 2018 16:45
@GaneshChandrasekaran-zzGaneshChandrasekaran-zz changed the titleWIP: Create new NotExpirableStoreException for stores which don't support …Create new NotExpirableStoreException for stores which don't support expiration of locksOct 4, 2018
@GaneshChandrasekaran-zz
Copy link
ContributorAuthor

GaneshChandrasekaran-zz commentedOct 4, 2018
edited
Loading

@jderusse - this is now ready for review.

Also, I can't figure out why it's failing in this environment
https://travis-ci.org/symfony/symfony/jobs/437228068

I have a feeling that it's reading files fromvendor directory but I am unable to confirm that from the stack trace.

@GaneshChandrasekaran-zzGaneshChandrasekaran-zzforce-pushed thegchandrasekaran_fixPutOffExpirationForZookeeperStore branch 2 times, most recently from7d89ad2 toacea2b6CompareOctober 8, 2018 12:34
@GaneshChandrasekaran-zzGaneshChandrasekaran-zz changed the titleCreate new NotExpirableStoreException for stores which don't support expiration of locksRefine the contract and implementation for Stores.Oct 8, 2018
@GaneshChandrasekaran-zzGaneshChandrasekaran-zzforce-pushed thegchandrasekaran_fixPutOffExpirationForZookeeperStore branch from2de1da7 to238958aCompareOctober 14, 2018 12:45
@GaneshChandrasekaran-zzGaneshChandrasekaran-zz changed the titleRefine the contract and implementation for Stores.Refine the contract and implementation for Stores to handle Not Expirable Store cases.Oct 14, 2018
@GaneshChandrasekaran-zzGaneshChandrasekaran-zzforce-pushed thegchandrasekaran_fixPutOffExpirationForZookeeperStore branch 2 times, most recently from01b7fba to4ec842aCompareOctober 15, 2018 12:06
@GaneshChandrasekaran-zzGaneshChandrasekaran-zz changed the titleRefine the contract and implementation for Stores to handle Not Expirable Store cases.[Lock] Refine the contract and implementation for Stores to handle Not Expirable Store cases.Oct 16, 2018
publicfunctionputOffExpiration(Key$key,$ttl)
{
// do nothing, the flock locks forever.
thrownewNotExpirableStoreException();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I wonder if it's should be treated like a BC break. ping@nicolas-grekas

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks like a BC break to me, but might be worth doing anyway instead of silently ignoring the call.

@GaneshChandrasekaran-zzGaneshChandrasekaran-zzforce-pushed thegchandrasekaran_fixPutOffExpirationForZookeeperStore branch fromed9d45e toc110405CompareOctober 16, 2018 07:50
@GaneshChandrasekaran-zzGaneshChandrasekaran-zzforce-pushed thegchandrasekaran_fixPutOffExpirationForZookeeperStore branch 2 times, most recently from85e6204 to3efcaa2CompareOctober 16, 2018 08:20
@nicolas-grekasnicolas-grekas added this to thenext milestoneOct 17, 2018
Copy link
Member

@fabpotfabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks good to me with two small comments.@jderusse I think we need your approval before merging.

publicfunctionputOffExpiration(Key$key,$ttl)
{
// do nothing, the flock locks forever.
thrownewNotExpirableStoreException();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks like a BC break to me, but might be worth doing anyway instead of silently ignoring the call.

}

returnnewCombinedStore(array(newRedisStore($redis)),newUnanimousStrategy());
$zookeeper_server =getenv('ZOOKEEPER_HOST').':2181';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Small typo, should be$zookeeperServer


$this->logger->info('Expiration defined for "{resource}" lock for "{ttl}" seconds.',array('resource' =>$this->key,'ttl' =>$ttl));
}catch (NotExpirableStoreException$e) {
$this->logger->notice('The store does not support expiration of locks.',array('store' =>$this->store));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The methodrefresh is called internally when callingacquire with a non-null TTL (which is the default case when using the Factory with default arguments)

When using a NotExpirableStore (like flock) the logger will be full of notice.
Same comment when combining a non-expirable store and expirable one (flock + redis for instance)

IMHO You should either silent this exception when callingacquire or update the factory to set a null TTL when the store does not support expiration.

Would be great from a user point of view to known whether or not the store supports expiration.

interface StoreInterface {  public function save(Key $key);  public function waitAndSave(Key $key);  public function delete(Key $key);  public function exists(Key $key);}interface ExpirableStoreInterface extends StoreInterface {  public function supportsExpiration(): bool  public function putOffExpiration(Key $key, $ttl);}

@jderusse
Copy link
Member

closed by#32299@fabpot

@fabpotfabpot closed thisJul 9, 2019
@nicolas-grekasnicolas-grekas modified the milestones:next,4.4Oct 27, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@jderussejderussejderusse approved these changes

@OskarStarkOskarStarkOskarStark left review comments

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

7 participants

@GaneshChandrasekaran-zz@jderusse@fabpot@OskarStark@nicolas-grekas@carsonbot@GaneshChandrasekaran

[8]ページ先頭

©2009-2025 Movatter.jp