Skip to content

Commit 9eb84c5

Browse files
jbonofrejeanouii
andauthored
Use of GitHub Actions, and enable dependabot (#1497)
* Use of GitHub Actions, and enable dependabot Keep a backup of Jenkinsfile for now * Include push/PR on activemq-6.1.x and activemq-5.19.x branches * Add new runners for the build * Set Java distribution * Remove surefire rerun options as deprecated * Removing JDK 24 for now as the tests will fail due to the SecurityManager * Remove JDK 21 as the tests will fail due to SecurityManager * Use separated jobs for build and test (to use different JDK matrix) Re-add -Dsurefire.rerunFailingTestsCount=3 option to tests * Update right GitHub Action syntax for options * Re-add Jenkinsfile with daily schedule, building only on s390x and including Sonar stage * Fix surefire argLine and set memory configuration * Temporary ignore JournalCorruptionEofIndexRecoveryTest to test the GitHub Action CI * Remove heap memory setting and renable KahaDB test * Clear separation between development cycle and nightly full check * Adding logs to trigger a new build * Revert latest for OS versions * Do not leak connections while constantly checking if the new connection is different from the failed one * Avoid race conditions by waiting for the log before creating the second consumer. * [AMQ-9820]: closed connections leaking into the pool when reconnectOnException is used * try to avoid failures when stats are not fully synchronized * Increase the timeout to allow statistics to sync up * switch the latch and the counter, to make sure we wait before asserting the values bellow * See if we can better fix the ConnectionPool * Add all platforms for on-demand Jenkins --------- Co-authored-by: Jean-Louis Monteiro <jlmonteiro@tomitribe.com>
1 parent 1fd234b commit 9eb84c5

File tree

14 files changed

+344
-157
lines changed

14 files changed

+344
-157
lines changed

.asf.yaml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,34 @@ github:
2929
- stomp
3030
- java
3131
- jms
32+
3233
enabled_merge_buttons:
3334
squash: true
34-
merge: true
35-
rebase: true
35+
merge: false
36+
rebase: false
37+
38+
del_branch_on_merge: true
39+
40+
protected_branches:
41+
main:
42+
required_pull_request_reviews:
43+
require_code_owner_reviews: false
44+
required_approving_review_count: 0
45+
required_linear_history: true
46+
required_status_checks:
47+
strict: false
48+
contexts:
49+
- build
50+
- test
51+
52+
features:
53+
wiki: false
54+
issues: false
55+
projects: false
56+
3657
autolink_jira:
3758
- AMQ
59+
3860
notifications:
3961
commits: commits@activemq.apache.org
4062
issues: gitbox@activemq.apache.org

.github/dependabot.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
version: 2
21+
updates:
22+
- package-ecosystem: "github-actions"
23+
directory: "/"
24+
schedule:
25+
interval: "daily"
26+
ignore:
27+
- dependency-name: "*"
28+
update-types: ["version-update:semver-major"]
29+
- package-ecosystem: "maven"
30+
directory: "/"
31+
schedule:
32+
interval: "daily"
33+
open-pull-requests-limit: 50
34+
ignore:
35+
- dependency-name: "*"
36+
update-types: ["version-update:semver-major"]

.github/workflows/ci-nightly.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: CI Nightly
19+
20+
on:
21+
schedule:
22+
- cron: '0 3 * * *'
23+
24+
jobs:
25+
build:
26+
27+
permissions:
28+
contents: read
29+
30+
strategy:
31+
matrix:
32+
os: [ ubuntu-24.04, ubuntu-22.04, macos-26, macos-15, windows-2025, windows-2022 ]
33+
java-version: [ 17, 21, 24 ]
34+
35+
runs-on: ${{ matrix.os }}
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
- name: Set up JDK
40+
uses: actions/setup-java@v4
41+
with:
42+
java-version: ${{ matrix.java-version }}
43+
distribution: temurin
44+
- name: Build
45+
run: mvn -U -B -e clean install -DskipTests
46+
- name: Verify
47+
run: mvn apache-rat:check
48+
49+
test:
50+
51+
permissions:
52+
contents: read
53+
54+
strategy:
55+
matrix:
56+
os: [ ubuntu-24.04, ubuntu-22.04, macos-26, macos-15, windows-2025, windows-2022 ]
57+
java-version: [ 17, 21, 24 ]
58+
59+
runs-on: ${{ matrix.os }}
60+
61+
steps:
62+
- uses: actions/checkout@v4
63+
- name: Set up JDK
64+
uses: actions/setup-java@v4
65+
with:
66+
java-version: ${{ matrix.java-version }}
67+
distribution: temurin
68+
- name: Test
69+
run: mvn -B -e -fae test

.github/workflows/ci-quick.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: CI Quick
19+
20+
on:
21+
push:
22+
branches: [ "main", "activemq-6.1.x", "activemq-5.19.x" ]
23+
pull_request:
24+
branches: [ "main", "activemq-6.1.x", "activemq-5.19.x" ]
25+
26+
jobs:
27+
build:
28+
29+
permissions:
30+
contents: read
31+
32+
strategy:
33+
matrix:
34+
os: [ ubuntu-24.04, macos-26, windows-2025 ]
35+
java-version: [ 17, 21 ]
36+
37+
runs-on: ${{ matrix.os }}
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Set up JDK
42+
uses: actions/setup-java@v4
43+
with:
44+
java-version: ${{ matrix.java-version }}
45+
distribution: temurin
46+
- name: Build
47+
run: mvn -U -B -e clean install -DskipTests
48+
- name: Verify
49+
run: mvn apache-rat:check
50+
51+
test:
52+
53+
permissions:
54+
contents: read
55+
56+
runs-on: ubuntu-24.04
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
- name: Set up JDK
61+
uses: actions/setup-java@v4
62+
with:
63+
java-version: 17
64+
distribution: temurin
65+
- name: Test
66+
run: mvn -B -e -fae test

.github/workflows/deploy.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
name: Deploy
21+
22+
on:
23+
schedule:
24+
- cron: '0 0 * * *'
25+
26+
jobs:
27+
deploy:
28+
29+
permissions:
30+
contents: read
31+
32+
runs-on: ubuntu-24.04
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: Set up JDK
37+
uses: actions/setup-java@v4
38+
with:
39+
java-version: 17
40+
distribution: temurin
41+
- name: Deploy
42+
run: mvn -B -e deploy -Pdeploy -DskipTests

Jenkinsfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ pipeline {
2727
}
2828
}
2929

30+
triggers {
31+
cron('0 0 * * *')
32+
}
33+
3034
tools {
3135
// ... tell Jenkins what java version, maven version or other tools are required ...
3236
maven 'maven_3_latest'
@@ -42,7 +46,7 @@ pipeline {
4246
}
4347

4448
parameters {
45-
choice(name: 'nodeLabel', choices: ['ubuntu', 's390x', 'arm', 'Windows'])
49+
choice(name: 'nodeLabel', choices: [ 'ubuntu', 's390x', 'arm', 'Windows' ])
4650
choice(name: 'jdkVersion', choices: ['jdk_17_latest', 'jdk_21_latest', 'jdk_24_latest', 'jdk_17_latest_windows', 'jdk_21_latest_windows', 'jdk_24_latest_windows'])
4751
booleanParam(name: 'deployEnabled', defaultValue: false)
4852
booleanParam(name: 'parallelTestsEnabled', defaultValue: true)

activemq-jms-pool/src/main/java/org/apache/activemq/jms/pool/ConnectionPool.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public void start() throws JMSException {
125125
connection.start();
126126
} catch (JMSException e) {
127127
started.set(false);
128+
setHasExpired(true);
128129
if (isReconnectOnException()) {
129130
close();
130131
}
@@ -377,6 +378,7 @@ void setParentExceptionListener(ExceptionListener parentExceptionListener) {
377378

378379
@Override
379380
public void onException(JMSException exception) {
381+
setHasExpired(true);
380382
if (isReconnectOnException()) {
381383
close();
382384
}

activemq-jms-pool/src/main/java/org/apache/activemq/jms/pool/PooledConnectionFactory.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,7 @@ public void destroyObject(ConnectionKey connectionKey, PooledObject<ConnectionPo
129129
@Override
130130
public boolean validateObject(ConnectionKey connectionKey, PooledObject<ConnectionPool> pooledObject) {
131131
ConnectionPool connection = pooledObject.getObject();
132-
if (connection == null || connection.getConnection() == null) {
133-
LOG.trace("Connection has been closed and will be destroyed: {}", connection);
134-
return false;
135-
}
136-
137-
if (connection.expiredCheck()) {
132+
if (connection != null && connection.expiredCheck()) {
138133
LOG.trace("Connection has expired: {} and will be destroyed", connection);
139134
return false;
140135
}

0 commit comments

Comments
 (0)