61
61
required : true
62
62
type : number
63
63
default : 10000
64
+ netty_leak_detection :
65
+ description : ' Controls Netty leak detection. When set to "report", Netty leak detection is enabled. When set to "fail_on_leak", Netty leak detection is enabled and a build job will fail if leaks are detected. When set to "off", Netty leak detection is disabled.'
66
+ required : true
67
+ type : choice
68
+ options :
69
+ - ' report'
70
+ - ' fail_on_leak'
71
+ - ' off'
72
+ default : ' report'
64
73
65
74
concurrency :
66
75
group : ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}${{ github.event_name == 'workflow_dispatch' && github.event.inputs.jdk_major_version || '' }}
85
94
collect_coverage : ${{ steps.check_coverage.outputs.collect_coverage }}
86
95
jdk_major_version : ${{ steps.jdk_major_version.outputs.jdk_major_version }}
87
96
java_non_tests : ${{ steps.changes.outputs.java_non_tests }}
97
+ netty_leak_detection : ${{ steps.netty_leak_detection.outputs.netty_leak_detection }}
88
98
steps :
89
99
- name : Cancel scheduled jobs in forks by default
90
100
if : ${{ github.repository != 'apache/pulsar' && github.event_name == 'schedule' }}
@@ -136,6 +146,13 @@ jobs:
136
146
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.collect_coverage == 'true')
137
147
}}" >> $GITHUB_OUTPUT
138
148
149
+ - name : Set Netty leak detection mode
150
+ id : netty_leak_detection
151
+ run : |
152
+ echo "netty_leak_detection=${{
153
+ github.event_name == 'workflow_dispatch' && github.event.inputs.netty_leak_detection || 'report'
154
+ }}" >> $GITHUB_OUTPUT
155
+
139
156
- name : Check if the PR has been approved for testing
140
157
if : ${{ steps.check_changes.outputs.docs_only != 'true' && github.repository == 'apache/pulsar' && github.event_name == 'pull_request' }}
141
158
env :
@@ -232,6 +249,8 @@ jobs:
232
249
TRACE_TEST_RESOURCE_CLEANUP_DIR : ${{ github.workspace }}/target/trace-test-resource-cleanup
233
250
THREAD_LEAK_DETECTOR_WAIT_MILLIS : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.thread_leak_detector_wait_millis || 10000 }}
234
251
THREAD_LEAK_DETECTOR_DIR : ${{ github.workspace }}/target/thread-leak-dumps
252
+ NETTY_LEAK_DETECTION : " ${{ needs.preconditions.outputs.netty_leak_detection }}"
253
+ NETTY_LEAK_DUMP_DIR : ${{ github.workspace }}/target/netty-leak-dumps
235
254
runs-on : ubuntu-22.04
236
255
timeout-minutes : ${{ matrix.timeout || 60 }}
237
256
needs : ['preconditions', 'build-and-license-check']
@@ -349,6 +368,10 @@ jobs:
349
368
cat threadleak*.txt | awk '/^Summary:/ {print "::warning::" $0 "\n"; next} {print}'
350
369
fi
351
370
371
+ - name : Report detected Netty leaks
372
+ if : ${{ always() && env.NETTY_LEAK_DETECTION != 'off' }}
373
+ run : $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh report_netty_leaks
374
+
352
375
- name : Upload Surefire reports
353
376
uses : actions/upload-artifact@v4
354
377
if : ${{ !success() || env.TRACE_TEST_RESOURCE_CLEANUP != 'off' }}
@@ -366,6 +389,7 @@ jobs:
366
389
/tmp/*.hprof
367
390
**/hs_err_*.log
368
391
**/core.*
392
+ ${{ env.NETTY_LEAK_DUMP_DIR }}/*
369
393
${{ env.TRACE_TEST_RESOURCE_CLEANUP_DIR }}/*
370
394
${{ env.THREAD_LEAK_DETECTOR_DIR }}/*
371
395
retention-days : 7
@@ -554,6 +578,8 @@ jobs:
554
578
PULSAR_TEST_IMAGE_NAME : apachepulsar/java-test-image:latest
555
579
DEVELOCITY_ACCESS_KEY : ${{ secrets.DEVELOCITY_ACCESS_KEY }}
556
580
CI_JDK_MAJOR_VERSION : ${{ needs.preconditions.outputs.jdk_major_version }}
581
+ NETTY_LEAK_DETECTION : " ${{ needs.preconditions.outputs.netty_leak_detection }}"
582
+ NETTY_LEAK_DUMP_DIR : ${{ github.workspace }}/target/netty-leak-dumps
557
583
strategy :
558
584
fail-fast : false
559
585
matrix :
@@ -702,6 +728,10 @@ jobs:
702
728
report_paths : ' test-reports/TEST-*.xml'
703
729
annotate_only : ' true'
704
730
731
+ - name : Report detected Netty leaks
732
+ if : ${{ always() && env.NETTY_LEAK_DETECTION != 'off' }}
733
+ run : $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh report_netty_leaks
734
+
705
735
- name : Upload Surefire reports
706
736
uses : actions/upload-artifact@v4
707
737
if : ${{ !success() }}
@@ -710,6 +740,19 @@ jobs:
710
740
path : surefire-reports
711
741
retention-days : 7
712
742
743
+ - name : Upload possible heap dump, core dump or crash files
744
+ uses : actions/upload-artifact@v4
745
+ if : ${{ always() }}
746
+ with :
747
+ name : Integration-${{ matrix.upload_name || matrix.group }}-dumps
748
+ path : |
749
+ /tmp/*.hprof
750
+ **/hs_err_*.log
751
+ **/core.*
752
+ ${{ env.NETTY_LEAK_DUMP_DIR }}/*
753
+ retention-days : 7
754
+ if-no-files-found : ignore
755
+
713
756
- name : Upload container logs
714
757
uses : actions/upload-artifact@v4
715
758
if : ${{ !success() }}
@@ -972,6 +1015,8 @@ jobs:
972
1015
PULSAR_TEST_IMAGE_NAME : apachepulsar/pulsar-test-latest-version:latest
973
1016
DEVELOCITY_ACCESS_KEY : ${{ secrets.DEVELOCITY_ACCESS_KEY }}
974
1017
CI_JDK_MAJOR_VERSION : ${{ needs.preconditions.outputs.jdk_major_version }}
1018
+ NETTY_LEAK_DETECTION : " ${{ needs.preconditions.outputs.netty_leak_detection }}"
1019
+ NETTY_LEAK_DUMP_DIR : ${{ github.workspace }}/target/netty-leak-dumps
975
1020
strategy :
976
1021
fail-fast : false
977
1022
matrix :
@@ -1079,6 +1124,10 @@ jobs:
1079
1124
report_paths : ' test-reports/TEST-*.xml'
1080
1125
annotate_only : ' true'
1081
1126
1127
+ - name : Report detected Netty leaks
1128
+ if : ${{ always() && env.NETTY_LEAK_DETECTION != 'off' }}
1129
+ run : $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh report_netty_leaks
1130
+
1082
1131
- name : Upload container logs
1083
1132
uses : actions/upload-artifact@v4
1084
1133
if : ${{ !success() }}
@@ -1096,6 +1145,19 @@ jobs:
1096
1145
path : surefire-reports
1097
1146
retention-days : 7
1098
1147
1148
+ - name : Upload possible heap dump, core dump or crash files
1149
+ uses : actions/upload-artifact@v4
1150
+ if : ${{ always() }}
1151
+ with :
1152
+ name : System-${{ matrix.group }}-dumps
1153
+ path : |
1154
+ /tmp/*.hprof
1155
+ **/hs_err_*.log
1156
+ **/core.*
1157
+ ${{ env.NETTY_LEAK_DUMP_DIR }}/*
1158
+ retention-days : 7
1159
+ if-no-files-found : ignore
1160
+
1099
1161
- name : Wait for ssh connection when build fails
1100
1162
# ssh access is enabled for builds in own forks
1101
1163
uses : ./.github/actions/ssh-access
@@ -1202,6 +1264,8 @@ jobs:
1202
1264
PULSAR_TEST_IMAGE_NAME : apachepulsar/pulsar-test-latest-version:latest
1203
1265
DEVELOCITY_ACCESS_KEY : ${{ secrets.DEVELOCITY_ACCESS_KEY }}
1204
1266
CI_JDK_MAJOR_VERSION : ${{ needs.preconditions.outputs.jdk_major_version }}
1267
+ NETTY_LEAK_DETECTION : " ${{ needs.preconditions.outputs.netty_leak_detection }}"
1268
+ NETTY_LEAK_DUMP_DIR : ${{ github.workspace }}/target/netty-leak-dumps
1205
1269
strategy :
1206
1270
fail-fast : false
1207
1271
matrix :
@@ -1286,23 +1350,40 @@ jobs:
1286
1350
report_paths : ' test-reports/TEST-*.xml'
1287
1351
annotate_only : ' true'
1288
1352
1353
+ - name : Report detected Netty leaks
1354
+ if : ${{ always() && env.NETTY_LEAK_DETECTION != 'off' }}
1355
+ run : $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh report_netty_leaks
1356
+
1289
1357
- name : Upload container logs
1290
1358
uses : actions/upload-artifact@v4
1291
1359
if : ${{ !success() }}
1292
1360
continue-on-error : true
1293
1361
with :
1294
- name : System-${{ matrix.group }}-container-logs
1362
+ name : Flaky- System-${{ matrix.group }}-container-logs
1295
1363
path : tests/integration/target/container-logs
1296
1364
retention-days : 7
1297
1365
1298
1366
- name : Upload Surefire reports
1299
1367
uses : actions/upload-artifact@v4
1300
1368
if : ${{ !success() }}
1301
1369
with :
1302
- name : System-${{ matrix.name }}-surefire-reports
1370
+ name : Flaky- System-${{ matrix.name }}-surefire-reports
1303
1371
path : surefire-reports
1304
1372
retention-days : 7
1305
1373
1374
+ - name : Upload possible heap dump, core dump or crash files
1375
+ uses : actions/upload-artifact@v4
1376
+ if : ${{ always() }}
1377
+ with :
1378
+ name : Flaky-System-${{ matrix.group }}-dumps
1379
+ path : |
1380
+ /tmp/*.hprof
1381
+ **/hs_err_*.log
1382
+ **/core.*
1383
+ ${{ env.NETTY_LEAK_DUMP_DIR }}/*
1384
+ retention-days : 7
1385
+ if-no-files-found : ignore
1386
+
1306
1387
- name : Wait for ssh connection when build fails
1307
1388
# ssh access is enabled for builds in own forks
1308
1389
uses : ./.github/actions/ssh-access
0 commit comments