-
Notifications
You must be signed in to change notification settings - Fork 72
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
GCS : Spring Boot service gets blocked with virtual thread and library version >= 2.25.0 during file upload #2548
Comments
I spent some time today trying to repro with just the JDK, skipping the Spring Boot Part. I did this by submitting several (tested up to 1000 a few times) upload tasks similar to the following (attempting to approximate what a server might be doing processing requests).
Unfortunately, I was not able to reproduce the hang and all uploads completed successfully.
Can you provide any more details about where you're running (GCE, GKE, On Prem, etc) and if on GCE/GKE, what instance type and size you are using? |
Did you enable virtual threads while trying to repro the case?
I am running the case in my local setup (mac m1).
sure, pfa the related thread dump |
Yes Virtual Threads where enabled by using
Thanks for sharing. Unfortunately, there isn't anything for I've got a PR up to reduce virtual thread pinning in Java 21 #2553 hopefully this can help. I'm hoping to have it merged in time for the next release. |
Version Can you give the new version a try and see if it helps in your environment? |
Seems to be working fine now with |
Awesome, thanks for confirming @Liveitabhi14! |
I was upgrading a codebase from Java 11 to Java 21 + Spring Boot 3.2.5
I then enabled virtual threads.
The codebase contains interactions with GCS via the Java Client library google-cloud-storage. So I upgraded the library version to the latest available one (2.37.0)
The codebase has mainly two interactions with Google Cloud storage, one for downloading and the other for uploading a file.
With the above-mentioned changes, the download functionality is working fine (even though there might be pinning of virtual threads). But the upload functionality is broken.
We are using the below line to upload an excel file to the GCS bucket.
storage.createFrom(blobInfo, new ByteArrayInputStream(excelBytes));
After enabling debug logs, these are the major logs that i am able to see :-
First is a post request
Following this is the response log for the above request
After this, there is another log but for a PUT request
And then there is this log at the end
After this, the execution keeps on going and the service becomes unresponsive.
Then I need to restart the spring boot service to be able to execute any other request on it.
I tried downgrading the google-cloud-storage library and at 2.24.0 version, its working fine.
One thing to note is that with 2.24.0 version where the flow is working fine, i am seeing the same order of logs as above 4.
The difference is that after the 4th one, there is a response log as well.
And this is followed by other logs trivial logs.
Also, the execution is completed immediately post which i am able to hit the service with any other requests.
The text was updated successfully, but these errors were encountered: