【Flink】Flink Dump of the process-tree for container Exit code is 143

在这里插入图片描述

1.背景

flink任务报错这个如下

2020-09-27 16:38:36,063 INFO  org.apache.flink.yarn.YarnResourceManager                
<div class="post-text" itemprop="text"> <p>I need to know the name of the go-package and function (including the receiver name) of the calling function.</p> <p>This is my current code:</p> <pre><code>func retrieveCallInfo() { pc, _, _, _ := runtime.Caller(1) funcName := runtime.FuncForPC(pc).Name() lastDot := strings.LastIndexByte(funcName, '.') fmt.Printf(" Package: %s ", funcName[:lastDot]) fmt.Printf(" Func: %s ", funcName[lastDot+1:]) } </code></pre> <p>However, the code doesn't behave exactly as it should.</p> <pre><code>// When called from a conventional (free) function: runtime.FuncForPC(pc).Name() // returns <package-path>.<funcName> // When called from a method receiver function: runtime.FuncForPC(pc).Name() // returns <package-path>.<receiverName>.<funcName> </code></pre> <p>When called from a receiver function, the receiver name is part of the package name, rather than the function name - which is not what I want.</p> <p>Here's a demonstration: <a href="https://play.golang.org/p/-99sZXr4ptD" rel="nofollow noreferrer">https://play.golang.org/p/-99sZXr4ptD</a></p> <p>In the second example, I want the package name to be <code>main</code> and the function name to be <code>empty.f</code>. Since dots are also valid parts of a package name, I can't simply split at another dot - maybe it's actually not the receiver, but part of the package name.</p> <p>Hence, the information returned by <code>runtime.FuncForPC()</code> is ambiguous and not enough.</p> <p>How can I get the correct results?</p> </div>
©️2020 CSDN 皮肤主题: 酷酷鲨 设计师:CSDN官方博客 返回首页
实付 39.90元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值