![](/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.