Skip to content

Connection pooling can be messed up by select() #4

Closed
@enaeseth

Description

@enaeseth

The following sequence of commands poses a problem for redis-py. It is a reduction of a real sequence of commands invoked by a copy script I wrote, and needless to say, figuring out the behavior in the comments confused me mightily.

 from redis import Redis
 source = Redis(db=0) # source opens a new connection to localhost/0
 dest = Redis(db=0)   # dest uses the existing connection to localhost/0
 source.select(1)     # since source and dest are sharing a connection,
                      # they will now both operate on database 1

 copy(source, dest)   # doesn't accomplish anything useful!

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