Close and re-open client context each 1000 nodes to avoid too many open files