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

Virtual thread pinning in procedure calling #34133

Open
AgilAghamirzayev opened this issue Dec 20, 2024 · 0 comments
Open

Virtual thread pinning in procedure calling #34133

AgilAghamirzayev opened this issue Dec 20, 2024 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged or decided on

Comments

@AgilAghamirzayev
Copy link

AgilAghamirzayev commented Dec 20, 2024

Virtual thread pinning in procedure calling

Hi, I am using Java 21, spring boot 3.3.2

When I enable virtual threads and -Djdk.tracePinnedThreads=short I got virtual thread pinning and deadlock my requests.

The pinning log :

Thread[#179,ForkJoinPool-1-worker-28,5,CarrierThreads]
org.springframework.jdbc.core.simple.AbstractJdbcCall.compile(AbstractJdbcCall.java:298) <== monitors:1

I review the code there used synchronized in method level. Could we change it to java locking library.

public final synchronized void compile() throws InvalidDataAccessApiUsageException {
		if (!isCompiled()) {
			if (getProcedureName() == null) {
				throw new InvalidDataAccessApiUsageException("Procedure or Function name is required");
			}
			try {
				this.jdbcTemplate.afterPropertiesSet();
			}
			catch (IllegalArgumentException ex) {
				throw new InvalidDataAccessApiUsageException(ex.getMessage());
			}
			compileInternal();
			this.compiled = true;
			if (logger.isDebugEnabled()) {
				logger.debug("SqlCall for " + (isFunction() ? "function" : "procedure") +
						" [" + getProcedureName() + "] compiled");
			}
		}
	}
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
Development

No branches or pull requests

2 participants