Skip to content
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

Refreshing via ContextRefresher pins virtual threads #1408

Open
martinvisser opened this issue Oct 24, 2024 · 0 comments
Open

Refreshing via ContextRefresher pins virtual threads #1408

martinvisser opened this issue Oct 24, 2024 · 0 comments

Comments

@martinvisser
Copy link

Describe the bug
With virtual threads enabled a call to /actuator/refresh pins virtual threads.

The ContextRefresher uses synchronized on both refresh and refreshEnvironment, so it seems they are not ready for use with virtual threads:

	public synchronized Set<String> refresh() {
		Set<String> keys = refreshEnvironment();
		this.scope.refreshAll();
		return keys;
	}

	public synchronized Set<String> refreshEnvironment() {
		Map<String, Object> before = extract(this.context.getEnvironment().getPropertySources());
		updateEnvironment();
		Set<String> keys = changes(before, extract(this.context.getEnvironment().getPropertySources())).keySet();
		this.context.publishEvent(new EnvironmentChangeEvent(this.context, keys));
		return keys;
	}

There could be more places of course

Are there plans to support virtual threads (with ReentrantLock)?

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

No branches or pull requests

2 participants