You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Reggie Quimosing <re...@gmail.com> on 2021/03/15 22:13:40 UTC

Attach remote debugger to task executor

I'm running flink locally via ./start-cluster.sh, and submitting my job via
./flink run <class, jar, etc>.

I can attach a debugger
<https://cwiki.apache.org/confluence/display/FLINK/Remote+Debugging+of+Flink+Clusters>
to the job client process using either:
export
JVM_ARGS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
or
env.java.opts:
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"

I can step through the main method of my job, but once my program gets to
DataStream.execute, the debugger does not follow. That code is now running
in a *separate* task executor process, and this is what I would really want
to debug.

Any tips on how to do this?

Thanks,
Reggie

Re: Attach remote debugger to task executor

Posted by Reggie Quimosing <re...@gmail.com>.
Thanks Julian, that worked! I totally missed this in the documentation.


On Mon, Mar 15, 2021 at 4:06 PM Jaffe, Julian <Ju...@activision.com>
wrote:

> You can use `env.java.opts.taskmanager` to specify java options for the
> task managers specifically. Be aware you may want to set `suspend=n` or be
> sure to attach your debugger promptly, otherwise the task manager may time
> out attempting to connect to the job manager (since it’s waiting for you to
> connect before running)
>
>
>
>
>
> *From: *Reggie Quimosing <re...@gmail.com>
> *Date: *Monday, March 15, 2021 at 3:14 PM
> *To: *"user@flink.apache.org" <us...@flink.apache.org>
> *Subject: *Attach remote debugger to task executor
>
>
>
> I'm running flink locally via ./start-cluster.sh, and submitting my job
> via ./flink run <class, jar, etc>.
>
>
>
> I can attach a debugger
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__cwiki.apache.org_confluence_display_FLINK_Remote-2BDebugging-2Bof-2BFlink-2BClusters&d=DwMFaQ&c=qE8EibqjfXM-zBfebVhd4gtjNZbrDcrKYXvb1gt38s4&r=zKznthi6OTKpoJID9dIcyiJ28NX59JIQ2bD246nnMac&m=Ai6018huGWYJiegl-egD2Rf1MJd2EotSIe0Ube4Z2UA&s=rCH0NQlpYVfSUsv5YUzlkEjUi5YcIfPtKw3O0NnJR0U&e=>
> to the job client process using either:
>
> export
> JVM_ARGS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
>
> or
>
> env.java.opts:
> "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
>
>
>
> I can step through the main method of my job, but once my program gets to
> DataStream.execute, the debugger does not follow. That code is now running
> in a *separate* task executor process, and this is what I would really
> want to debug.
>
>
>
> Any tips on how to do this?
>
>
>
> Thanks,
>
> Reggie
>
>
>
>
>

Re: Attach remote debugger to task executor

Posted by "Jaffe, Julian" <Ju...@activision.com>.
You can use `env.java.opts.taskmanager` to specify java options for the task managers specifically. Be aware you may want to set `suspend=n` or be sure to attach your debugger promptly, otherwise the task manager may time out attempting to connect to the job manager (since it’s waiting for you to connect before running)


From: Reggie Quimosing <re...@gmail.com>
Date: Monday, March 15, 2021 at 3:14 PM
To: "user@flink.apache.org" <us...@flink.apache.org>
Subject: Attach remote debugger to task executor

I'm running flink locally via ./start-cluster.sh, and submitting my job via ./flink run <class, jar, etc>.

I can attach a debugger<https://urldefense.proofpoint.com/v2/url?u=https-3A__cwiki.apache.org_confluence_display_FLINK_Remote-2BDebugging-2Bof-2BFlink-2BClusters&d=DwMFaQ&c=qE8EibqjfXM-zBfebVhd4gtjNZbrDcrKYXvb1gt38s4&r=zKznthi6OTKpoJID9dIcyiJ28NX59JIQ2bD246nnMac&m=Ai6018huGWYJiegl-egD2Rf1MJd2EotSIe0Ube4Z2UA&s=rCH0NQlpYVfSUsv5YUzlkEjUi5YcIfPtKw3O0NnJR0U&e=> to the job client process using either:
export JVM_ARGS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
or
env.java.opts: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"

I can step through the main method of my job, but once my program gets to DataStream.execute, the debugger does not follow. That code is now running in a separate task executor process, and this is what I would really want to debug.

Any tips on how to do this?

Thanks,
Reggie