Foreach hangs when underlying function throws an error

scan
python

#1

Hi, the “foreach” function call hangs when the underlying function throw an exception. For example the following code without “print 1/0” part is working fine and prints stack trace and the first “key, bins” pair and exit, but with the “print 1/0” it prints the stack trace and hangs.

def print_key((key, meta, bins)):
        import traceback
        traceback.print_stack()
        print 1 / 0  # any code which throws an exception
        print key[2], bins
        return False

client.scan('some_namespace')
client.foreach(print_key)

Tried with both concurrent values(True, False). In case of False the process is just hanging, in case of True the process infinitly prints the same stack trace.


#2

Please open an issue with the aerospike/aerospike-client-python repo on GitHub. Can you also add the version of the server, and the client release you’re working with, and the OS?

Thanks.


#3

Opened issue at github - https://github.com/aerospike/aerospike-client-python/issues/109 Thanks