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