add retry logic for writing to hdfs