Skip to content
This repository was archived by the owner on Aug 13, 2026. It is now read-only.
This repository was archived by the owner on Aug 13, 2026. It is now read-only.

No clear way to populate multiple host/port pairs? #153

Description

@danostrowski

Mostly leaving this as a bookmark to add a patch later, but I noticed that version "2" of the transports accept a connection manager. However, for backwards compatibility, I assume, the RiakClient only accepts host/port.

This brings up the obvious issue that if I wanted to provide multiple host/port pairs to the client, I have to know the internals as far as I can tell.

The other less obvious behavior is that, for example, I use a proxy in front of Riak and I suspect that's not too uncommon. The current connection stuff loops through available connections and then tries a different connection if the current one gets an HTTP reset (which is, I think, a little conservative) but there doesn't seem to be much support for retrying the same host/port. A workaround, obviously, is adding the same host/port more than once. As I said; not obvious, necessarily.

I think the fix is probably something like adding another kwarg to RiakClient's __init__ method like "hostports=None" and allowing a iterable to fill that slot. I don't know if passing in a cm is a good idea, just because it seems like an implementation detail that could change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions