Skip to content

Quarkus smallrye-graphql exstension bug with GQL subscriptions #35225

Open

Description

Describe the bug

On Kotlin code with graphql subscription implementation is the bug on error handling when the Multi produce some exception. If the exception produced a some unsubscribe the Multi (BroadcastProducer) but no error broadcasted to Client and Socket connection does not closed.

I focus on Kotlin, because on clear Java all works fine.

Expected behavior

The client receive a marshaled exception and the socket connection will close by server.

Actual behavior

The software subscriber unsubscribe the Multi flow into Quarkus App and nothing more.

How to Reproduce?

For reproduce:

  1. Download the simple project reproducing
  2. Run it
  3. Sorry, I didn't write the test, so go to the http://localhost:8080/q/dev-ui/io.quarkus.quarkus-smallrye-graphql/graphql-ui page
  4. Run the subscription by evaluating the query:
subscription s{
  testSubscription
}
  1. It should raise error and close the connection immediately

In technical step enoth declare:

import io.smallrye.graphql.api.Subscription
import io.smallrye.mutiny.Multi
import org.eclipse.microprofile.graphql.GraphQLApi

class TestError(errorMessage: String): RuntimeException(errorMessage)

@GraphQLApi
class TestGqlController {

    @Subscription
    fun testSubscription(): Multi<String> {

        return Multi.createFrom().failure(TestError("Something went wrong."))
    }
}

and try the query

Output of uname -a or ver

Linux ferri 6.4.6-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 24 20:51:12 UTC 2023 x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.7" 2023-04-18 OpenJDK Runtime Environment (Red_Hat-17.0.7.0.7-4.fc38) (build 17.0.7+7) OpenJDK 64-Bit Server VM (Red_Hat-17.0.7.0.7-4.fc38) (build 17.0.7+7, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.2.3.Final, 3.2.0.Final, 2.16.5.Final (I tried plural)

Build tool (ie. output of mvnw --version or gradlew --version)

------------------------------------------------------------ Gradle 8.1.1 ------------------------------------------------------------ Build time: 2023-04-21 12:31:26 UTC Revision: 1cf537a851c635c364a4214885f8b9798051175b Kotlin: 1.8.10 Groovy: 3.0.15 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 17.0.7 (Red Hat, Inc. 17.0.7+7) OS: Linux 6.4.6-200.fc38.x86_64 amd64

Additional information

No response

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions