![](/img/trans.png)
[英]Google Cloud Dataflow (Python SDK) : Workflow failed | Each time the worker process eventually lost contact with the service
[英]Google Cloud Dataflow fails in combine function due to worker losing contact
我的数据流在我的合并功能中始终失败,除以下一项外,日志中未报告任何错误:
A work item was attempted 4 times without success. Each time the worker eventually lost contact with the service.
我正在使用Apache Beam Python SDK 2.4.0。 我尝试使用CombinePerKey和CombineGlobally执行此步骤。 在两种情况下,管道均无法执行合并功能。 当运行少量数据时,管道完成。
我是在耗尽工人资源而不被告知吗? 是什么会导致工人失去与服务的联系?
更新:
使用n1-highmem-4
工作人员n1-highmem-4
给我带来同样的失败。 当我检查Stackdriver时,没有看到任何错误,但是出现了三种警告:未No session file found
, Refusing to split
和Processing lull
。 我的输入集合大小表明,它分布在约60 MB的空间中有17,000个元素,但是Stackdriver发表声明说,我正在单个工作人员上使用约25 GB的空间,这正在达到最大。 对于此输入,在我的CombineFn中创建的每个累加器应占用大约150 MB的内存。 我的管道会创建太多累加器并耗尽其内存吗? 如果是这样,我如何告诉它更频繁地合并累加器或限制创建的累加器数量?
我确实有一个错误日志条目,验证我的工作人员是否因OOM而死亡。 它只是没有被标记为工作程序错误,这是Dataflow监视器的默认筛选。
管道定义看起来像:
table1 = (p | "Read Table1" >> beam.io.Read(beam.io.BigQuerySource(query=query))
| "Key rows" >> beam.Map(lambda row: (row['key'], row)))
table2 = (p | "Read Table2" >> beam.io.Read(beam.io.BigQuerySource(query=query))
| "Key rows" >> beam.Map(lambda row: (row['key'], row)))
merged = ({"table1": table1, "table2": table2}
| "Join" >> beam.CoGroupByKey()
| "Reshape" >> beam.ParDo(ReshapeData())
| "Key rows" >> beam.Map(lambda row: (row['key'], row)))
| "Build matrix" >> beam.CombinePerKey(MatrixCombiner()) # Dies here
| "Write matrix" >> beam.io.avroio.WriteToAvro())
以更少的工人来运行可以减少累加器并成功完成管道。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.