Skip to content

Add has_connection to BaseConnection#56

Merged
alfredodeza merged 1 commit intoalfredodeza:masterfrom
matthewoliver:connection_has_connection
Jun 12, 2020
Merged

Add has_connection to BaseConnection#56
alfredodeza merged 1 commit intoalfredodeza:masterfrom
matthewoliver:connection_has_connection

Conversation

@matthewoliver
Copy link
Contributor

If the other end of a connection dies it would be good to have a way to
check if it's still alive without having to send a command and catch an
error.

This patch adds a has_connection method to BaseConnection. We want
to use it in the ceph orchestrator to be able to check the state of the
connection for longer lived health checks.

Signed-off-by: Matthew Oliver moliver@suse.com

If the other end of a connection dies it would be good to have a way to
check if it's still alive without having to send a command and catch an
error.

This patch adds a `has_connection` method to `BaseConnection`. We want
to use it in the ceph orchestrator to be able to check the state of the
connection for longer lived health checks.

Signed-off-by: Matthew Oliver <moliver@suse.com>
matthewoliver pushed a commit to matthewoliver/ceph that referenced this pull request May 28, 2020
Currently we make and cache connections to nodes during a check_host.
If a cached connection is disconnect from the other end the remoto
connection object doesn't track this, so further checks to the host
fail.

I have pushed up a PR[0] to remoto to add a `has_connection` method to
their `BaseConnection` class, which we now use in this patch to check to
see if the connection is stale. If it is it is then recreated.

There is some monkey patching happening so we can add the required
`has_connection` to remoto in this patch which we can remove as soon as
the other PR have landed and a new version of remoto is released.

[0] alfredodeza/remoto#56
Fixes: https://tracker.ceph.com/issues/45627
Fixes: https://tracker.ceph.com/issues/45032
Signed-off-by: Matthew Oliver <moliver@suse.com>
matthewoliver pushed a commit to matthewoliver/ceph that referenced this pull request May 28, 2020
Currently we make and cache connections to nodes during a check_host.
If a cached connection is disconnect from the other end the remoto
connection object doesn't track this, so further checks to the host
fail.

I have pushed up a PR[0] to remoto to add a `has_connection` method to
their `BaseConnection` class, which we now use in this patch to check to
see if the connection is stale. If it is it is then recreated.

There is some monkey patching happening so we can add the required
`has_connection` to remoto in this patch which we can remove as soon as
the other PR have landed and a new version of remoto is released.

[0] alfredodeza/remoto#56
Fixes: https://tracker.ceph.com/issues/45627
Fixes: https://tracker.ceph.com/issues/45032
Signed-off-by: Matthew Oliver <moliver@suse.com>
matthewoliver pushed a commit to matthewoliver/ceph that referenced this pull request May 28, 2020
Currently we make and cache connections to nodes during a check_host.
If a cached connection is disconnect from the other end the remoto
connection object doesn't track this, so further checks to the host
fail.

I have pushed up a PR[0] to remoto to add a `has_connection` method to
their `BaseConnection` class, which we now use in this patch to check to
see if the connection is stale. If it is it is then recreated.

There is some monkey patching happening so we can add the required
`has_connection` to remoto in this patch which we can remove as soon as
the other PR have landed and a new version of remoto is released.

[0] alfredodeza/remoto#56
Fixes: https://tracker.ceph.com/issues/45627
Fixes: https://tracker.ceph.com/issues/45032
Signed-off-by: Matthew Oliver <moliver@suse.com>
sebastian-philipp pushed a commit to sebastian-philipp/ceph that referenced this pull request Jun 2, 2020
Currently we make and cache connections to nodes during a check_host.
If a cached connection is disconnect from the other end the remoto
connection object doesn't track this, so further checks to the host
fail.

I have pushed up a PR[0] to remoto to add a `has_connection` method to
their `BaseConnection` class, which we now use in this patch to check to
see if the connection is stale. If it is it is then recreated.

There is some monkey patching happening so we can add the required
`has_connection` to remoto in this patch which we can remove as soon as
the other PR have landed and a new version of remoto is released.

[0] alfredodeza/remoto#56
Fixes: https://tracker.ceph.com/issues/45627
Fixes: https://tracker.ceph.com/issues/45032
Signed-off-by: Matthew Oliver <moliver@suse.com>
(cherry picked from commit afabf82)
ideepika pushed a commit to ceph/ceph-ci that referenced this pull request Jun 4, 2020
Currently we make and cache connections to nodes during a check_host.
If a cached connection is disconnect from the other end the remoto
connection object doesn't track this, so further checks to the host
fail.

I have pushed up a PR[0] to remoto to add a `has_connection` method to
their `BaseConnection` class, which we now use in this patch to check to
see if the connection is stale. If it is it is then recreated.

There is some monkey patching happening so we can add the required
`has_connection` to remoto in this patch which we can remove as soon as
the other PR have landed and a new version of remoto is released.

[0] alfredodeza/remoto#56
Fixes: https://tracker.ceph.com/issues/45627
Fixes: https://tracker.ceph.com/issues/45032
Signed-off-by: Matthew Oliver <moliver@suse.com>
@alfredodeza alfredodeza merged commit 8dc32e2 into alfredodeza:master Jun 12, 2020
@sebastian-philipp
Copy link

Thanks Alfredo!

ideepika pushed a commit to ceph/ceph-ci that referenced this pull request Sep 3, 2020
Currently we make and cache connections to nodes during a check_host.
If a cached connection is disconnect from the other end the remoto
connection object doesn't track this, so further checks to the host
fail.

I have pushed up a PR[0] to remoto to add a `has_connection` method to
their `BaseConnection` class, which we now use in this patch to check to
see if the connection is stale. If it is it is then recreated.

There is some monkey patching happening so we can add the required
`has_connection` to remoto in this patch which we can remove as soon as
the other PR have landed and a new version of remoto is released.

[0] alfredodeza/remoto#56
Fixes: https://tracker.ceph.com/issues/45627
Fixes: https://tracker.ceph.com/issues/45032
Signed-off-by: Matthew Oliver <moliver@suse.com>
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.

3 participants