Skip to content
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

Minimize Redis connection shadowing #12

Open
JakeCooper opened this issue Feb 27, 2017 · 1 comment
Open

Minimize Redis connection shadowing #12

JakeCooper opened this issue Feb 27, 2017 · 1 comment
Assignees
Labels

Comments

@JakeCooper
Copy link
Member

Use <-done at the end of incomingTxWatcher to block variables from losing scope. Also add the defer call there too.

Issue being that the L15 of incomingTxWatcher could shadow a variable used somewhere else.

@JakeCooper JakeCooper added the bug label Feb 27, 2017
@JakeCooper JakeCooper self-assigned this Feb 27, 2017
@trstephen
Copy link
Member

trstephen commented Feb 28, 2017

I thought about it and I'm not sure we need to use <-done to maintain scope. handler should be the one responsible for getting a redis connection from the pool.

  1. Pools (mostly) eliminate the connection setup overhead by re-using idle connections
  2. If you have a single connection for all of incomingTxWatcher does that mean each instance of handler will try to use the same connection? It seems like danger lies ahead if we use a single connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants