Skip to content

Fix: PineconeGrpcFuture blocks during construction #478

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yorickvP
Copy link

@yorickvP yorickvP commented May 7, 2025

Problem

When using grpc with async_req=True, the construction of a PineconeGrpcFuture would call _sync_state, which would do a blocking call to grpc_future.exception(...). This means that the async reqs were all blocking in practice.

Describe the purpose of this change. What problem is being solved and why?

Solution

We can fix it by checking if the future is still running and not doing any blocking calls when it is.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

How I tested it:

  • Before: Run a long query in a loop and hit ctrl-c. Observe the traceback containing PineconeGrpcFuture()
  • After: Run a long query in a loop and hit ctrl-c. Observe the traceback containing your .result() call instead.

When using grpc with async_req, the construction of a
PineconeGrpcFuture would call _sync_state, which would do a blocking
call to grpc_future.exception(...). This means that the async_reqs
were all blocking in practice.

We can fix it by checking if the future is still running and not doing
any blocking calls when it is.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant