aerospike-client-python
aerospike-client-python copied to clipboard
Getting Segmentation fault on aerospike.client.scan.foreach() after select()
I have the following code, which is running fine for one aerospike set but throwing following error for
import aerospike
import sys,traceback
import redis
import time
import json
import sys
def process_result((key, metadata, record)):
try:
print "key" //This is printing for working set
//Removed all other logic from here.
except:
print("Got errors in processing " + key[2])
columnNames = {0:'PK',1:'merchantInKey'}
client = aerospike.client(config).connect()
scan = client.scan('namespace', 'setname')
#print type(columnNames)
scan.select(**columnNames)
scan.foreach(process_result)
Error -
Segmentation fault (core dumped)
Specifying fields like following, instead of **columnNames in the above example works -
scan.select('PK','merchantInKey')
Stackoverflow link https://stackoverflow.com/questions/51599240/getting-segmentation-fault-on-aerospike-client-scan-foreach-after-select
Hi,
Could you share the versions of Python and the Aerospike Python client you are using? Also if you have the backtrace from the core dump, that would be useful.
scan.select is expecting a variable number of string arguments, and not a set of keyword arguments, so specifying them as scan.select('PK', 'merchantInKey') is the way to go.