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

Error with Qdrant #52

Open
tbolis-at-mulesoft opened this issue Nov 24, 2024 · 0 comments
Open

Error with Qdrant #52

tbolis-at-mulesoft opened this issue Nov 24, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@tbolis-at-mulesoft
Copy link
Member

Qdrant raising following error.

The error indicates that a gRPC channel was garbage collected without being properly shut down. This happens when the shutdown() or shutdownNow() methods on the channel are not called before the object is no longer referenced. This is a common issue in Java applications using gRPC if the lifecycle of the client or channel is not managed correctly.

When creating a QdrantGrpcClient, we need to ensure the channel is properly shut down when no longer needed.

import io.qdrant.client.QdrantGrpcClient;

public class QdrantClientExample {
    public static void main(String[] args) {
        QdrantGrpcClient client = null;

        try {
            // Initialize Qdrant client
            client = QdrantGrpcClient.newBuilder()
                    .setHost("localhost")
                    .setPort(6334)
                    .build();

            // Perform operations with the client
            System.out.println("Client is ready: " + client);

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            // Properly shutdown the client to close the channel
            if (client != null) {
                client.close();  // Ensures shutdown of the gRPC channel
            }
        }
    }
}

FYI @Anush008

ERROR 2024-11-24 20:47:52,410 [[MuleRuntime].uber.13: [mac-vectors-app].mac-vectors-appFlow-add-folder.CPU_LITE @6b57008e] [processor: mac-vectors-appFlow-add-folder/processors/0; event: fde5a340-aa9c-11ef-8425-603e5f642d78] io.grpc.internal.ManagedChannelOrphanWrapper: ~* Previous channel ManagedChannelImpl{logId=29, target=localhost:6334} was garbage collected without being shut down! *~
Make sure to call shutdown()/shutdownNow()
java.lang.RuntimeException: ManagedChannel allocation site
at io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.(ManagedChannelOrphanWrapper.java:102) ~[grpc-core-1.65.1.jar:1.65.1]
at io.grpc.internal.ManagedChannelOrphanWrapper.(ManagedChannelOrphanWrapper.java:60) ~[grpc-core-1.65.1.jar:1.65.1]
at io.grpc.internal.ManagedChannelOrphanWrapper.(ManagedChannelOrphanWrapper.java:51) ~[grpc-core-1.65.1.jar:1.65.1]
at io.grpc.internal.ManagedChannelImplBuilder.build(ManagedChannelImplBuilder.java:709) ~[grpc-core-1.65.1.jar:1.65.1]
at io.grpc.ForwardingChannelBuilder2.build(ForwardingChannelBuilder2.java:272) ~[grpc-api-1.65.1.jar:1.65.1]
at io.qdrant.client.QdrantGrpcClient$Builder.createChannel(QdrantGrpcClient.java:234) ~[client-1.11.0.jar:?]
at io.qdrant.client.QdrantGrpcClient$Builder.(QdrantGrpcClient.java:177) ~[client-1.11.0.jar:?]
at io.qdrant.client.QdrantGrpcClient.newBuilder(QdrantGrpcClient.java:93) ~[client-1.11.0.jar:?]
at org.mule.extension.vectors.internal.store.qdrant.QdrantStore.(QdrantStore.java:44) ~[mule4-vectors-connector-0.2.2-SNAPSHOT-mule-plugin.jar:?]
at org.mule.extension.vectors.internal.store.BaseStore$Builder.build(BaseStore.java:300) ~[mule4-vectors-connector-0.2.2-SNAPSHOT-mule-plugin.jar:?]
at org.mule.extension.vectors.internal.operation.EmbeddingOperations.queryByFilterFromEmbedding(EmbeddingOperations.java:472) ~[mule4-vectors-connector-0.2.2-SNAPSHOT-mule-plugin.jar:?]
at org.mule.extension.vectors.internal.operation.EmbeddingOperations$queryByFilterFromEmbedding$MethodComponentExecutor_mac_vectors_app.execute(Unknown Source) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.execution.GeneratedMethodComponentExecutor.execute(GeneratedMethodComponentExecutor.java:94) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.execution.CompletableMethodOperationExecutor.doExecute(CompletableMethodOperationExecutor.java:26) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.execution.AbstractCompletableMethodOperationExecutor.execute(AbstractCompletableMethodOperationExecutor.java:61) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.executeCommand(DefaultExecutionMediator.java:254) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.executeWithInterceptors(DefaultExecutionMediator.java:237) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$execute$1(DefaultExecutionMediator.java:144) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$new$0(DefaultExecutionMediator.java:80) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.withExecutionTemplate(DefaultExecutionMediator.java:335) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.execute(DefaultExecutionMediator.java:143) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.executeOperation(ComponentMessageProcessor.java:582) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.prepareAndExecuteOperation(ComponentMessageProcessor.java:828) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.access$100(ComponentMessageProcessor.java:192) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor$4.lambda$innerEventDispatcher$6(ComponentMessageProcessor.java:685) ~[?:?]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableConditionalSubscriber.onNext(FluxPeekFuseable.java:489) ~[reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableConditionalSubscriber.onNext(FluxPeekFuseable.java:503) ~[reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107) ~[reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:880) ~[reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxCreate$BufferAsyncSink.next(FluxCreate.java:805) ~[reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxCreate$SerializedFluxSink.next(FluxCreate.java:163) ~[reactor-core-3.6.8.jar:3.6.8]
at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.lambda$onEvent$13(ComponentMessageProcessor.java:450) ~[?:?]
at org.mule.runtime.core.internal.policy.DefaultPolicyManager.lambda$static$0(DefaultPolicyManager.java:85) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.onEvent(ComponentMessageProcessor.java:461) ~[?:?]
at org.mule.runtime.module.extension.internal.runtime.operation.ComponentMessageProcessor.lambda$createOuterFlux$6(ComponentMessageProcessor.java:402) ~[?:?]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableConditionalSubscriber.onNext(FluxPeekFuseable.java:489) [reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxHandleFuseable$HandleFuseableConditionalSubscriber.onNext(FluxHandleFuseable.java:505) [reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableConditionalSubscriber.onNext(FluxPeekFuseable.java:503) [reactor-core-3.6.8.jar:3.6.8]
at org.mule.runtime.core.privileged.processor.chain.AbstractMessageProcessorChain$2.onNext(AbstractMessageProcessorChain.java:625) [mule-core-4.8.0.jar:4.8.0]
at org.mule.runtime.core.privileged.processor.chain.AbstractMessageProcessorChain$2.onNext(AbstractMessageProcessorChain.java:620) [mule-core-4.8.0.jar:4.8.0]
at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137) [reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210) [reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) [reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210) [reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210) [reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210) [reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.runAsync(FluxPublishOn.java:446) [reactor-core-3.6.8.jar:3.6.8]
at reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.run(FluxPublishOn.java:533) [reactor-core-3.6.8.jar:3.6.8]
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84) [reactor-core-3.6.8.jar:3.6.8]
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37) [reactor-core-3.6.8.jar:3.6.8]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_422]
at org.mule.service.scheduler.internal.AbstractRunnableFutureDecorator.doRun(AbstractRunnableFutureDecorator.java:180) [mule-service-scheduler-1.8.0.jar:1.8.0]
at org.mule.service.scheduler.internal.RunnableFutureDecorator.run(RunnableFutureDecorator.java:55) [mule-service-scheduler-1.8.0.jar:1.8.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_422]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_422]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_422]

@tbolis-at-mulesoft tbolis-at-mulesoft self-assigned this Nov 24, 2024
@tbolis-at-mulesoft tbolis-at-mulesoft added the bug Something isn't working label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant