1

We are using pycassa with uwsgi. There are about 16 uwsgi processes.

It is strange that one process can get the data which is queried by another process. e.g. there is one row in column family A, looks like:

{row_key, {'column_a': 1, 'column_b': 2}}

process 1 run: get(row_key, columns=['column_a', ])

process 2 run: get(row_key, columns=['column_b', ])

but, sometimes, process 1 got value of column_b, process 2 got value of column_a.

Is this a known issue of connection pool?

Any response is appreciated.

Zhongwei Sun
  • 125
  • 1
  • 7

1 Answers1

2

Open a connection for every worker using the uwsgi.post_fork_hook api function

import uwsgi

def myconnect(...):

global_connection = ...

uwsgi.post_fork_hook = myconnect
sra
  • 23,820
  • 7
  • 55
  • 89
roberto
  • 36
  • 1