-
Notifications
You must be signed in to change notification settings - Fork 3k
Virtual thread support for smallrye-graphql #47802
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
Conversation
Thanks for your pull request! Your pull request does not follow our editorial rules. Could you have a look?
This message is automatically generated by a bot. |
We'll need @cescoffier for this as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks ok, but we need to check if there is any pinning or monopolization happening.
For pinning you can add a flag when running tests (https://quarkus.io/guides/virtual-threads#detect-pinned-thread-in-tests).
Unfortunately for monopolization, it's more tricky. We need to make sure that the operation is not CPU intensive.
Nice !. @jmartisk let's get the smallrye PR in and released, then we can get this builing in CI |
@cescoffier in the I added some tests for pinning (Query and Mutation) seems there is no pinning, should we test more variants for pinning? Do we need to support combinations of |
No, virtual threads are only for blocking (it could work, but would be quite convoluted). In general, we declare these configurations invalid.
Unfortunately, there is no magic wand here. But it should not block merging this. |
...untime/src/main/java/io/quarkus/smallrye/graphql/runtime/spi/datafetcher/BlockingHelper.java
Outdated
Show resolved
Hide resolved
You will need to add
to I'm planning to release SmallRye GraphQL 2.14 with this soon so that the Quarkus side can move forward.. |
Btw I am also getting 10 failures in |
It should have, but I only ran the tests via intellijs test runner, where they worked. Running via maven, I get the same errors. I missed one annotation, now it should work. |
@ShouldNotPin | ||
class RunOnVirtualThreadTest extends AbstractGraphQLTest { | ||
|
||
//todo how to make sure vt executor is not removed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe @cescoffier knows - do we have any general mechanism to detect usage of virtual threads?
At minimum though, in case we are to keep this injection, I would move it into the RunOnVirtualThreadObjectTestThreadResource
subclass because then it won't prevent running this test in native mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it to the subclass.
Any news on smallrye graphql release? @jmartisk |
Ah right, thanks for reminding me, I'll do it today |
@robp94 2.14.0 should be released now, can you upgrade it in the pom here and unmark as draft? |
0657061
to
5cc15e3
Compare
@jmartisk I upgraded it and marked the pr as ready, so there are still some open questions, like how to make sure the vt executor is not removed. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🙈 The PR is closed and the preview is expired. |
62a6de5
to
a719272
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Good question. @ozangunalp do we need both, or just the executor? |
That did not work, I now use
But I am not that familiar with the build stuff of quarkus, so not sure if this is correct or we can do somthing else. |
There shouldn't be any need to check for VT executor. In the Again, no need to add unremovable bean. |
7544357
to
f23b2e0
Compare
Well that makes things simpler, I changed it as supposed. |
This comment has been minimized.
This comment has been minimized.
@robp94 The change looks good, can you squash your commits? |
f23b2e0
to
67d73d8
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
67d73d8
to
3280ec4
Compare
Status for workflow
|
Status for workflow
|
Thanks @robp94 !!! Nice work |
is there plan to backport this to 3.20 version of quarkus. |
As a feature that is both new and experimental, this is not planned to be backported. With LTS branches, we tend to be rather conservative. |
Fixes #35605
Needs a branch from smallrye grapgql smallrye/smallrye-graphql#2287Some questions:
How to prevent the virtual thread executor from being removed?Probably we will need more tests, but at least io.quarkus.virtual.graphql.RunOnVirtualThreadTest#testAnnotatedBlockingObject tests for virtual thread and works.