Skip to content

Comments

Add gRPC ping check to is_live method #1949

Merged
tsmith023 merged 2 commits intoweaviate:mainfrom
sylvinho81:feature/is-live-grpc-health-check
Feb 18, 2026
Merged

Add gRPC ping check to is_live method #1949
tsmith023 merged 2 commits intoweaviate:mainfrom
sylvinho81:feature/is-live-grpc-health-check

Conversation

@sylvinho81
Copy link
Contributor

@sylvinho81 sylvinho81 commented Feb 18, 2026

This PR add gRPC ping check to is_live method.
Closes #1948

Copy link

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@sylvinho81 sylvinho81 changed the title Add gRPC ping check to is_live method #1948 Add gRPC ping check to is_live method Feb 18, 2026
@sylvinho81
Copy link
Contributor Author

Hi @Shah91n

We opened a PR and noticed the CI pipeline is trying to download the artifact coverage-report-integration-embedded from workflow run #22132946685, but it doesn’t exist.

The artifacts that are actually available for that run are:

coverage-report-integration

coverage-report-mock_tests

coverage-report-test

weaviate-python-client-wheel

Could you clarify if coverage-report-integration-embedded is supposed to be uploaded in the workflow? Right now, this is causing the download step in the CI to fail.

Image

@tsmith023
Copy link
Collaborator

Hi @sylvinho81, there's no need to worry about codecov!

async with weaviate.use_async_with_weaviate_cloud(
cluster_url=WCS_URL, auth_credentials=WCS_CREDS, skip_init_checks=True
) as client:
assert await client.is_live()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are great but there's one more case I'd like added to cover this change when init checks are skipped and one of the ports is wrong, which looks like:

def test_client_is_not_live_with_wrong_rest_port() -> None:
    with weaviate.connect_to_local(
        port=9000, # wrong
        skip_init_checks=True
    ) as client:
        assert not client.is_live()

def test_client_is_not_live_with_wrong_grpc_port() -> None:
    with weaviate.connect_to_local(
        grpc_port=90000, # wrong
        skip_init_checks=True
    ) as client:
        assert not client.is_live()

please could you add this case for sync and async then I'll merge!

Copy link
Contributor Author

@sylvinho81 sylvinho81 Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tsmith023

By looking at your suggested tests we think that they will fail and raise the exception like in the existing tests. If we specify a wrong port the connection will fail.

def test_connect_to_wrong_wcs() -> None:
    with pytest.raises(WeaviateStartUpError):
        weaviate.connect_to_wcs("does-not-exist", auth_credentials=WCS_CREDS, skip_init_checks=True)


def test_connect_to_wrong_local() -> None:
    with pytest.raises(expected_exception=WeaviateStartUpError):
        weaviate.connect_to_local("does-not-exist", skip_init_checks=True)


def test_connect_to_wrong_custom() -> None:
    with pytest.raises(expected_exception=WeaviateStartUpError):
        weaviate.connect_to_custom(
            "does-not-exist",
            http_port=1234,
            http_secure=False,
            grpc_host="does-not-exist",
            grpc_port=2345,
            grpc_secure=False,
            skip_init_checks=True,
        )

Instead we could just create the connection with the right ports and change it in the context. Something like this:

def test_client_is_not_live_with_wrong_rest_port() -> None:
    with weaviate.connect_to_local(skip_init_checks=True) as client:
        # Simulate a wrong REST port after connecting.
        client._connection.url = "http://localhost:9000"
        assert not client.is_live()

def test_client_is_not_live_with_wrong_grpc_port() -> None:
    with weaviate.connect_to_local(skip_init_checks=True) as client:
        # Simulate a wrong gRPC port after connecting.
        client._connection._connection_params.grpc.port = 90000
        # Clear channel and stub so ping fails and cleanup doesn't break
        client._connection._grpc_channel = None
        client._connection._grpc_stub = None
        assert not client.is_live()

Just let us know if this works and we add those tests.
Thanks

Copy link
Collaborator

@tsmith023 tsmith023 Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, apologies for getting that so wrong! I do wonder whether skip_init_checks should truly skip all init checks so that it is less confusing 🤔

The second example looks good!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes have been pushed, ready for review.

@weaviate-git-bot
Copy link

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Forum?

@sylvinho81
Copy link
Contributor Author

I agree with the CLA

@sylvinho81 sylvinho81 requested a review from tsmith023 February 18, 2026 10:59
@tsmith023 tsmith023 merged commit de81891 into weaviate:main Feb 18, 2026
119 of 121 checks passed
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.

Adding gRPC health check ping to be a part of is_live()

3 participants