Attach remote debugger to task executor

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Attach remote debugger to task executor

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

I can attach a debugger 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


Reply | Threaded
Open this post in threaded view
|

Re: Attach remote debugger to task executor

Jaffe, Julian

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 <[hidden email]>
Date: Monday, March 15, 2021 at 3:14 PM
To: "[hidden email]" <[hidden email]>
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 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

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Attach remote debugger to task executor

Reggie Quimosing
Thanks Julian, that worked! I totally missed this in the documentation.


On Mon, Mar 15, 2021 at 4:06 PM Jaffe, Julian <[hidden email]> 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 <[hidden email]>
Date: Monday, March 15, 2021 at 3:14 PM
To: "[hidden email]" <[hidden email]>
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 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