Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrates from deprecated RaceTestUtils.race; fixes observed issues #1008

Merged
merged 2 commits into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/gradle-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Branches Java CI

on:
# Trigger the workflow on push
# but only for the non master/1.0.x branches
push:
branches-ignore:
- 1.0.x
- master

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest ]
jdk: [ 1.8, 11, 14 ]
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.jdk }}
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew clean build
- name: Publish Packages to Artifactory
if: ${{ matrix.jdk == '1.8' }}
run: ./gradlew -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PversionSuffix="-${githubRef#refs/heads/}-SNAPSHOT" -PbuildNumber="${buildNumber}" artifactoryPublish --stacktrace
env:
bintrayUser: ${{ secrets.bintrayUser }}
bintrayKey: ${{ secrets.bintrayKey }}
githubRef: ${{ github.ref }}
buildNumber: ${{ github.run_number }}
53 changes: 53 additions & 0 deletions .github/workflows/gradle-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Main Branches Java CI

on:
# Trigger the workflow on push
# but only for the master/1.0.x branch
push:
branches:
- master
- 1.0.x

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest ]
jdk: [ 1.8, 11, 14 ]
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.jdk }}
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew clean build
- name: Publish Packages to Artifactory
if: ${{ matrix.jdk == '1.8' }}
run: ./gradlew -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PversionSuffix="-SNAPSHOT" -PbuildNumber="${buildNumber}" artifactoryPublish --stacktrace
env:
bintrayUser: ${{ secrets.bintrayUser }}
bintrayKey: ${{ secrets.bintrayKey }}
buildNumber: ${{ github.run_number }}
- name: Aggregate test reports with ciMate
if: always()
continue-on-error: true
env:
CIMATE_PROJECT_ID: m84qx17y
run: |
wget -q https://get.cimate.io/release/linux/cimate
chmod +x cimate
./cimate "**/TEST-*.xml"
31 changes: 31 additions & 0 deletions .github/workflows/gradle-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Pull Request Java CI

on: [pull_request]

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest ]
jdk: [ 1.8, 11, 14 ]
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.jdk }}
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew clean build
44 changes: 44 additions & 0 deletions .github/workflows/gradle-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release Java CI

on:
# Trigger the workflow on push
push:
# Sequence of patterns matched against refs/tags
tags:
- '*' # Push events to matching *, i.e. 1.0, 20.15.10

jobs:
publish:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest ]
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew clean build
- name: Publish Packages to Bintray
run: ./gradlew -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" -Pversion="${githubRef#refs/tags/}" -PbuildNumber="${buildNumber}" bintrayUpload
env:
bintrayUser: ${{ secrets.bintrayUser }}
bintrayKey: ${{ secrets.bintrayKey }}
sonatypeUsername: ${{ secrets.sonatypeUsername }}
sonatypePassword: ${{ secrets.sonatypePassword }}
githubRef: ${{ github.ref }}
buildNumber: ${{ github.run_number }}
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ subprojects {
links 'https://projectreactor.io/docs/core/release/api/'
links 'https://netty.io/4.1/api/'
}
failOnError = false
}

tasks.named("javadoc").configure {
Expand Down
44 changes: 0 additions & 44 deletions ci/travis.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public RSocketConnector metadataMimeType(String metadataMimeType) {
* <li>For server-to-server connections, a reasonable time interval between client {@code
* KEEPALIVE} frames is 500ms.
* <li>For mobile-to-server connections, the time interval between client {@code KEEPALIVE}
* frames is often > 30,000ms.
* frames is often {@code >} 30,000ms.
* </ul>
*
* <p>By default these are set to 20 seconds and 90 seconds respectively.
Expand Down
15 changes: 11 additions & 4 deletions rsocket-core/src/main/java/io/rsocket/core/ResolvingOperator.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,19 @@ public T block(@Nullable Duration timeout) {
delay = System.nanoTime() + timeout.toNanos();
}
for (; ; ) {
BiConsumer<T, Throwable>[] inners = this.subscribers;
subscribers = this.subscribers;

if (inners == READY) {
if (subscribers == READY) {
final T value = this.value;
if (value != null) {
return value;
} else {
// value == null means racing between invalidate and this block
// thus, we have to update the state again and see what happened
inners = this.subscribers;
subscribers = this.subscribers;
}
}
if (inners == TERMINATED) {
if (subscribers == TERMINATED) {
RuntimeException re = Exceptions.propagate(this.t);
re = Exceptions.addSuppressed(re, new Exception("Terminated with an error"));
throw re;
Expand All @@ -174,6 +174,12 @@ public T block(@Nullable Duration timeout) {
throw new IllegalStateException("Timeout on Mono blocking read");
}

// connect again since invalidate() has happened in between
if (subscribers == EMPTY_UNSUBSCRIBED
&& SUBSCRIBERS.compareAndSet(this, EMPTY_UNSUBSCRIBED, EMPTY_SUBSCRIBED)) {
this.doSubscribe();
}

Thread.sleep(1);
}
} catch (InterruptedException ie) {
Expand All @@ -186,6 +192,7 @@ public T block(@Nullable Duration timeout) {
@SuppressWarnings("unchecked")
final void terminate(Throwable t) {
if (isDisposed()) {
Operators.onErrorDropped(t, Context.empty());
return;
}

Expand Down
Loading