I am finding if I so non-batch calls using the C Client things are fine. I can do 1000 retrievals, no problem.
However if I make a batch call, with a callback that just returns true, there is an issue. The program seg-faults if I try to do 50 loops of batch retrievals, versus say 5. This occurs when I put in a sleep of 1 second between loop iterations as well.
for (int i = 0; i < 5; i++) {
as_batch batch;
as_batch_inita(&batch, 3);
as_key_init(as_batch_keyat(&batch, 0), "ns", "r", "keyA");
as_key_init(as_batch_keyat(&batch, 1), "ns", "r", "keyB");
as_key_init(as_batch_keyat(&batch, 2), "ns", "r", "keyC");
printf("H0\n");
aerospike_batch_get(as, &err, NULL, &batch, batch_read_cb, NULL);
printf("H2\n");
as_key_destroy(as_batch_keyat(&batch, 0));
as_key_destroy(as_batch_keyat(&batch, 1));
as_key_destroy(as_batch_keyat(&batch, 2));
printf("H3\n");
as_batch_destroy(&batch);
printf("H4\n");
as_error_reset(&err);
}
bool batch_read_cb(const as_batch_read* results, uint32_t n, void* udata)
{
printf("H1\n");
return true;
}