Skip to content

[MRESOLVER-184] Destroy Redisson semaphores if not used anymore#108

Closed
michael-o wants to merge 1 commit into
masterfrom
MRESOLVER-184
Closed

[MRESOLVER-184] Destroy Redisson semaphores if not used anymore#108
michael-o wants to merge 1 commit into
masterfrom
MRESOLVER-184

Conversation

@michael-o
Copy link
Copy Markdown
Member

No description provided.

@michael-o michael-o requested a review from cstamas May 26, 2021 17:45
@Inject
public RedissonSemaphoreNamedLockFactory()
{
super();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

?

@cstamas
Copy link
Copy Markdown
Member

cstamas commented May 28, 2021

IMO -1 for this PR (but +1 for removal of semaphores, but let's do it differently), let me explain:
a) you do same thing as lock factory (map of locks by name), repeating
b) lets add new method (ie. destroy()) on NamedLockSupport that is by default noop, and is overridden by those (redis, hz) that needs to do something when lock destroyed by factory (as ref count goes to 0).

This way, all this PR becomes just a change in createLock method, where you override destroy method of created NamedLockSupport. WDYT?

This cleans up this flow as well: lock.close -> factory.close -IF refCount = 0-> destroyLock -> lock.destroy

@cstamas
Copy link
Copy Markdown
Member

cstamas commented May 28, 2021

Alternate PR #110

@michael-o
Copy link
Copy Markdown
Member Author

Superseded by #111.

@michael-o michael-o closed this Jun 13, 2021
@michael-o michael-o deleted the MRESOLVER-184 branch June 13, 2021 19:32
@jira-importer
Copy link
Copy Markdown

Resolve #1416

1 similar comment
@jira-importer
Copy link
Copy Markdown

Resolve #1416

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants