Skip to content

Fixes livelock#3

Open
sventorben wants to merge 1 commit into
tomitribe:masterfrom
sventorben:livelock
Open

Fixes livelock#3
sventorben wants to merge 1 commit into
tomitribe:masterfrom
sventorben:livelock

Conversation

@sventorben

Copy link
Copy Markdown

This fixes a livelock when a custom scoped bean depends on another bean of the same scope.

When two beans have the same custom scope and depend on each other (see thread dump in screenshot: CouchDbDatabaseName and MandantLuceneCouchDbConnector), I randomly get a livelock.

threaddump

This PR should fix this.

@simschla

Copy link
Copy Markdown

is this ever going to be merged?

@simschla

Copy link
Copy Markdown

🥳

@exabrial

Copy link
Copy Markdown
Collaborator

So I was able to randomly reproduce this problem, and I had a setup similar to yours where I had beans of the same scope. However, I think the problem was self-induced

Initially I had:

	@Inject
	@Destroyed(MyCustomScopeScoped.class)
	private Event<Object> scopeDestroyed;
	
	...
	
				context.destroy(newScopeKey);
				scopeDestroyed.fire(newScopeKey); // <-- observed by beans of the same scope
				context.exit(null);

but to fix it, I needed to tear down in this order:

scopeDestroyed.fire(newScopeKey);
context.destroy(newScopeKey);
context.exit(null);

any chance that is your issue?

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