hdfs 集群通过 fuse_dfs 挂在本地使用
启动多进程,每个进程中读 hdfs 下一个普通文本文件,有一定概率导致 CPU 负载 100%,挂在的 hdfs hang 住,运行 df -h 等命令卡住。
t_file = "/hdfs/test.txt"
def func(msg):
print "msg:", msg
# 这步有一定概率 hang 住,导致 cpu 负载 100%,挂载的 hdfs 集群不可访问。
with open(t_file, "r") as f:
print f.readlines()
print "end.., msg = ", msg
if __name__ == "__main__":
pool = multiprocessing.Pool(processes = 7)
for i in xrange(7):
msg = "hello %d" %(i)
pool.apply_async(func, (msg, ))
pool.close()
pool.join()
print "done."