Build end with java.io.IOException: cannot find current thread - Agent was removed

We have a pipeline which mainly launches make targets on a jenkins node (distant site) which has a poor network connection.
Builds are stopped during a stage where make targets are running curl or venv commands with the exception given in the subject.
Nevertheless, though the “agent was removed” message, it appears from the node page that the node has not been disconnected or restarted.

When connected as user jenkins onto the same node and running make targets from the command line there is no error.
When running the exact same job on another node (local site with a GB network bandwith), we encounter no problem.

So… we suspect some combination between the poor network quality and the java environment…
How could we have more information in order to debug or… is there some known tuning to avoid such a behavior.

The node is running java 17 :

>java -version
openjdk version "17.0.14" 2025-01-21
OpenJDK Runtime Environment (build 17.0.14+7-Ubuntu-122.04.1)
OpenJDK 64-Bit Server VM (build 17.0.14+7-Ubuntu-122.04.1, mixed mode, sharing)

Here is our jenkins configuration :

Jenkins: 2.492.1
OS: Linux - 4.19.0-16-amd64
Java: 17.0.14 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
Office-365-Connector:5.1.0
active-directory:2.39
analysis-model-api:13.1.0
ansible:500.v7564a_db_8feec
ansicolor:1.0.6
ant:513.vde9e7b_a_0da_0f
antisamy-markup-formatter:173.v680e3a_b_69ff3
apache-httpcomponents-client-4-api:4.5.14-269.vfa_2321039a_83
apache-httpcomponents-client-5-api:5.4-136.v5a_21779c63f8
artifactory:4.0.8
asm-api:9.7.1-97.v4cc844130d97
authentication-tokens:1.119.v50285141b_7e1
authorize-project:2.0.0
badge:2.6
basic-branch-build-strategies:190.v343a_ee70d920
blackduck-detect:10.0.0
blackduck-security-scan:2.0.1
blueocean:1.27.16
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.27.16
blueocean-commons:1.27.16
blueocean-config:1.27.16
blueocean-core-js:1.27.16
blueocean-dashboard:1.27.16
blueocean-display-url:2.4.3
blueocean-events:1.27.16
blueocean-git-pipeline:1.27.16
blueocean-github-pipeline:1.27.16
blueocean-i18n:1.27.16
blueocean-jira:1.27.16
blueocean-jwt:1.27.16
blueocean-personalization:1.27.16
blueocean-pipeline-api-impl:1.27.16
blueocean-pipeline-editor:1.27.16
blueocean-pipeline-scm-api:1.27.16
blueocean-rest:1.27.16
blueocean-rest-impl:1.27.16
blueocean-web:1.27.16
bootstrap5-api:5.3.3-2
bouncycastle-api:2.30.1.80-256.vf98926042a_9b_
branch-api:2.1214.v3f652804588d
build-monitor-plugin:1.14-961.v676e38a_7a_248
build-name-setter:2.5.0
build-pipeline-plugin:2.0.2
build-timeout:1.36
build-timestamp:1.1.0
build-user-vars-plugin:195.v8c35f9d5c3dc
built-on-column:1.5
caffeine-api:3.2.0-161.v691ef352cee1
categorized-view:164.v1c1b_dd4cdb_62
checks-api:2.2.3
cloud-stats:377.vd8a_6c953e98e
cloudbees-bitbucket-branch-source:935.0.0
cloudbees-disk-usage-simple:232.v713eeed2e1f4
cloudbees-folder:6.982.vf165a_16c9507
cmakebuilder:4.1.1
cobertura:1.17
code-coverage-api:4.99.0
collapsing-console-sections:1.11.0
command-launcher:118.v72741845c17a_
commons-compress-api:1.26.1-2
commons-httpclient3-api:3.1-3
commons-lang3-api:3.17.0-84.vb_b_938040b_078
commons-text-api:1.13.0-153.v91dcd89e2a_22
compress-buildlog:1.2
conditional-buildstep:1.5.0
config-file-provider:982.vb_a_e458a_37021
copyartifact:765.v0357cc6e6eb_3
coverage:2.1.0
cppcheck:1.26
credentials:1408.va_622a_b_f5b_1b_1
credentials-binding:687.v619cb_15e923f
custom-checkbox-parameter:1.4
dashboard-view:2.528.v3470c02b_d7c9
data-tables-api:2.2.2-1
description-setter:264.v1957f215dcd5
display-console-output:1.0.5
display-url-api:2.209.v582ed814ff2f
docker-commons:445.v6b_646c962a_94
docker-compose-build-step:1.0
docker-java-api:3.4.1-96.v77147a_de67f8
docker-plugin:1.9.0
docker-workflow:596.v3e6972b_46b_e2
dtkit-api:3.0.3
durable-task:581.v299a_5609d767
echarts-api:5.6.0-1
eddsa-api:0.3.0-13.v7cb_69ed68f00
editable-choice:71.v02a291ebbe45
email-ext:1876.v28d8d38315b_d
emailext-template:224.va_f6a_ecd5d46e
embeddable-build-status:548.v5653c6e28c41
emoji-symbols-api:16.0-26.v9818ff7423f0
envinject:2.926.v69c9b_3896a_96
envinject-api:1.235.va_14c74f8f487
extended-choice-parameter:388.ve7b_d0b_920e10
extended-read-permission:61.vf24570ff3b_e9
extensible-choice-parameter:1.8.1
external-monitor-job:221.v35059272565b_
extra-columns:1.27
favorite:2.225.v68765b_b_a_1fa_3
file-operations:349.v9b_4118623c89
file-parameters:358.v9ed4456a_169a_
font-awesome-api:6.7.2-1
forensics-api:3.0.0
git:5.7.0
git-changelog:3.43
git-client:6.1.2
git-parameter:0.11.0
git-server:126.v0d945d8d2b_39
github:1.42.0
github-api:1.321-478.vc9ce627ce001
github-autostatus:3.6.2
github-branch-source:1810.v913311241fa_9
github-oauth:621.v33b_4394dda_4d
github-pullrequest:0.7.2
gitlab-api:5.6.0-100.v83f8f4b_f1129
gradle:2.14
greenballs:1.15.1
groovy:497.v7b_061a_a_de65d
groovy-postbuild:272.v52a_03efb_8653
gson-api:2.12.1-113.v347686d6729f
h2-api:11.1.4.199-30.v1c64e772f3a_c
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-30.v7e777411b_148
htmlpublisher:1.37
http_request:1.20
instance-identity:201.vd2a_b_5a_468a_a_6
ionicons-api:82.v0597178874e1
jackson2-api:2.17.0-389.va_5c7e45cd806
jacoco:3.3.7
jakarta-activation-api:2.1.3-2
jakarta-mail-api:2.1.3-2
javadoc:310.v032f3f16b_0f8
javax-activation-api:1.2.0-8
javax-mail-api:1.6.2-11
jaxb:2.3.9-1
jdk-tool:83.v417146707a_3d
jenkins-design-language:1.27.16
jenkins-multijob-plugin:662.vd2e0001f6b_b_d
jersey2-api:2.45-154.v4ded3dc34f81
jfrog:1.5.8
jira:3.13
jjwt-api:0.11.5-120.v0268cf544b_89
jnr-posix-api:3.1.20-125.vb_6ec4b_21b_15e
job-dsl:1.90
job-import-plugin:122.v35289550f1e6
jobConfigHistory:1305.vf20a_356586b_8
joda-time-api:2.13.1-115.va_6b_5f8efb_1d8
jquery:1.12.4-3
jquery-detached:1.2.1
jquery3-api:3.7.1-3
jsch:0.2.16-86.v42e010d9484b_
json-api:20250107-125.v28b_a_ffa_eb_f01
json-path-api:2.9.0-148.v22a_7ffe323ce
jsoup:1.18.3-30.v952e9442d416
junit:1317.v5b_35d792b_06a_
locale:566.v3323643741cc
lockable-resources:1349.v8b_ccb_c5487f7
log-parser:2.3.7
mailer:489.vd4b_25144138f
mapdb-api:1.0.9-40.v58107308b_7a_7
mask-passwords:188.v66e477dcb_24a_
matrix-auth:3.2.4
matrix-project:845.vffd7fa_f27555
maven-plugin:3.25
metrics:4.2.21-461.v881e35d8fa_b_a_
mina-sshd-api-common:2.14.0-143.v2b_362fc39576
mina-sshd-api-core:2.14.0-143.v2b_362fc39576
momentjs:1.1.1
monitoring:2.5.0
nodejs:1.6.4
nodelabelparameter:1.14.0
okhttp-api:4.11.0-183.va_87fc7a_89810
oss-symbols-api:296.v4981240eeb_1a_
pam-auth:1.11
parameter-separator:276.v7b_5328f5c7a_d
parameterized-scheduler:285.ve611986d4c48
parameterized-trigger:840.v3c7d4a_a_5e6c7
pipeline-build-step:555.v589d5c24a_3d6
pipeline-github-lib:65.v203688e7727e
pipeline-graph-analysis:231.v56354571a_da_0
pipeline-groovy-lib:752.vdddedf804e72
pipeline-input-step:513.v7eb_fe7e2c0fc
pipeline-maven:1488.vfd8c04864236
pipeline-maven-api:1488.vfd8c04864236
pipeline-milestone-step:127.vb_52887ca_3b_6d
pipeline-model-api:2.2221.vc657003fb_d93
pipeline-model-definition:2.2221.vc657003fb_d93
pipeline-model-extensions:2.2221.vc657003fb_d93
pipeline-rest-api:2.37
pipeline-stage-step:322.vecffa_99f371c
pipeline-stage-tags-metadata:2.2221.vc657003fb_d93
pipeline-stage-view:2.37
pipeline-utility-steps:2.18.0
plain-credentials:183.va_de8f1dd5a_2b_
plain-text-console-link:3.v4d0a_0211e683
plot:2.4.0
plugin-usage-plugin:4.9
plugin-util-api:6.0.0
popper-api:1.16.1-3
popper2-api:2.11.6-5
prism-api:1.29.0-19
prometheus:819.v50953a_c560dd
promoted-builds:978.v4536a_f065dd8
protecode-sc:0.19.1
publish-over:0.22
pubsub-light:1.18
rebuild:338.va_0a_b_50e29397
resource-disposer:0.25
robot:5.0.0
role-strategy:756.v978cb_392eb_d3
run-condition:243.v3c3f94e46a_8b_
saferestart:102.v4dc1b_9636a_ee
saml:4.525.v4f6a_7209447e
scm-api:703.v72ff4b_259600
script-security:1373.vb_b_4a_a_c26fa_00
sidebar-link:2.4.2
simple-theme-plugin:202.v6367d3dea_73b_
sloccount:1.27
snakeyaml-api:2.3-123.v13484c65210a_
sonar:2.18
sse-gateway:1.27
ssh:158.ve2a_e90fb_7319
ssh-agent:376.v8933585c69d3
ssh-credentials:349.vb_8b_6b_9709f5b_
ssh-slaves:3.1031.v72c6b_883b_869
ssh-steps:2.0.79.v1d1b_5f76dda_8
sshd:3.353.v2b_d33c46e970
structs:343.vdcf37b_a_c81d5
summary_report:1.15
synopsys-coverity:3.0.5
text-finder:1.31
throttle-concurrents:2.16
timestamper:1.28
token-macro:444.v52de7e9c573d
trilead-api:2.190.v1ed19f8137f8
uno-choice:2.8.6
valgrind:0.28
variant:70.va_d9f17f859e0
warnings-ng:12.3.0
workflow-aggregator:600.vb_57cdd26fdd7
workflow-api:1363.v03f731255494
workflow-basic-steps:1079.vce64b_a_929c5a_
workflow-cps:4018.vf02e01888da_f
workflow-durable-task-step:1405.v1fcd4a_d00096
workflow-job:1505.vea_4b_20a_4a_495
workflow-multibranch:800.v5f0a_a_660950e
workflow-scm-step:437.v05a_f66b_e5ef8
workflow-step-api:700.v6e45cb_a_5a_a_21
workflow-support:946.v2a_79d8a_4b_e14
ws-cleanup:0.48
xunit:3.1.5