mirror of
https://github.com/praktimarc/kst4contest.git
synced 2026-08-23 18:47:34 +02:00
on4kst: add the jdk.net module to every packaging module list and stop connection setup from failing silently
The ON4KST connection manager introduced in f8c04e7 uses
jdk.net.ExtendedSocketOptions to configure kernel side TCP keepalives. The
new dependency was added to module-info.java and to the jpackage Maven
plugin, but the CI and AUR builds do not use that plugin: they call jpackage
directly with a hardcoded --add-modules list that still lacked jdk.net.
Because jdk.net is not pulled in transitively, every packaged runtime image
shipped without the class while development runs against the full JDK and
kept working.
The resulting NoClassDefFoundError is an Error, so neither the catch in
configureSocket nor the surrounding catch (Exception) in openConnection
handled it. Running on a ScheduledExecutorService, the throwable was stored
in the task future and never surfaced, leaving the state machine stuck in
CONNECTING with no reconnect attempt and no user visible failure.
Add jdk.net to all 16 module lists, covering nightly artifacts, tagged
releases and both AUR PKGBUILDs, so releases are affected as well as
nightlies. Additionally catch LinkageError in configureSocket so a runtime
image without jdk.net degrades to application level heartbeats, and catch
Throwable in openConnection so an Error can no longer be swallowed by the
scheduler.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -71,7 +71,7 @@ jobs:
|
|||||||
--main-jar app.jar `
|
--main-jar app.jar `
|
||||||
--main-class kst4contest.view.Kst4ContestApplication `
|
--main-class kst4contest.view.Kst4ContestApplication `
|
||||||
--module-path target/dist-libs `
|
--module-path target/dist-libs `
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec `
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net `
|
||||||
--dest dist
|
--dest dist
|
||||||
|
|
||||||
- name: Create Windows ZIP
|
- name: Create Windows ZIP
|
||||||
@@ -128,7 +128,7 @@ jobs:
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--dest dist
|
--dest dist
|
||||||
|
|
||||||
- name: Create AppDir metadata
|
- name: Create AppDir metadata
|
||||||
@@ -214,7 +214,7 @@ jobs:
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--linux-package-deps "libgstreamer1.0-0,libgstreamer-plugins-base1.0-0,gstreamer1.0-plugins-good" \
|
--linux-package-deps "libgstreamer1.0-0,libgstreamer-plugins-base1.0-0,gstreamer1.0-plugins-good" \
|
||||||
--dest dist
|
--dest dist
|
||||||
DEB="$(ls dist/*.deb | head -n 1)"
|
DEB="$(ls dist/*.deb | head -n 1)"
|
||||||
@@ -274,7 +274,7 @@ jobs:
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--linux-package-deps "gstreamer1,gstreamer1-plugins-base,gstreamer1-plugins-good" \
|
--linux-package-deps "gstreamer1,gstreamer1-plugins-base,gstreamer1-plugins-good" \
|
||||||
--dest dist
|
--dest dist
|
||||||
RPM="$(ls dist/*.rpm | head -n 1)"
|
RPM="$(ls dist/*.rpm | head -n 1)"
|
||||||
@@ -336,7 +336,7 @@ jobs:
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--dest dist
|
--dest dist
|
||||||
|
|
||||||
- name: Build Arch Linux package artifact
|
- name: Build Arch Linux package artifact
|
||||||
@@ -455,7 +455,7 @@ jobs:
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--dest target/flatpak-src
|
--dest target/flatpak-src
|
||||||
|
|
||||||
- name: Create Flatpak manifest
|
- name: Create Flatpak manifest
|
||||||
@@ -643,7 +643,7 @@ jobs:
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--dest dist
|
--dest dist
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ jobs:
|
|||||||
--main-jar app.jar `
|
--main-jar app.jar `
|
||||||
--main-class kst4contest.view.Kst4ContestApplication `
|
--main-class kst4contest.view.Kst4ContestApplication `
|
||||||
--module-path target/dist-libs `
|
--module-path target/dist-libs `
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec `
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net `
|
||||||
--dest dist
|
--dest dist
|
||||||
|
|
||||||
- name: Create Windows ZIP
|
- name: Create Windows ZIP
|
||||||
@@ -106,7 +106,7 @@ jobs:
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--dest dist
|
--dest dist
|
||||||
|
|
||||||
- name: Create AppDir metadata
|
- name: Create AppDir metadata
|
||||||
@@ -185,7 +185,7 @@ jobs:
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--linux-package-deps "libgstreamer1.0-0,libgstreamer-plugins-base1.0-0,gstreamer1.0-plugins-good" \
|
--linux-package-deps "libgstreamer1.0-0,libgstreamer-plugins-base1.0-0,gstreamer1.0-plugins-good" \
|
||||||
--dest dist
|
--dest dist
|
||||||
DEB="$(ls dist/*.deb | head -n 1)"
|
DEB="$(ls dist/*.deb | head -n 1)"
|
||||||
@@ -238,7 +238,7 @@ jobs:
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--linux-package-deps "gstreamer1,gstreamer1-plugins-base,gstreamer1-plugins-good" \
|
--linux-package-deps "gstreamer1,gstreamer1-plugins-base,gstreamer1-plugins-good" \
|
||||||
--dest dist
|
--dest dist
|
||||||
RPM="$(ls dist/*.rpm | head -n 1)"
|
RPM="$(ls dist/*.rpm | head -n 1)"
|
||||||
@@ -291,7 +291,7 @@ jobs:
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--dest dist
|
--dest dist
|
||||||
|
|
||||||
- name: Build Arch Linux package artifact
|
- name: Build Arch Linux package artifact
|
||||||
@@ -401,7 +401,7 @@ jobs:
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--dest target/flatpak-src
|
--dest target/flatpak-src
|
||||||
|
|
||||||
- name: Create Flatpak manifest
|
- name: Create Flatpak manifest
|
||||||
@@ -531,7 +531,7 @@ jobs:
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--dest dist
|
--dest dist
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ build() {
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--dest dist
|
--dest dist
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ build() {
|
|||||||
--main-jar app.jar \
|
--main-jar app.jar \
|
||||||
--main-class kst4contest.view.Kst4ContestApplication \
|
--main-class kst4contest.view.Kst4ContestApplication \
|
||||||
--module-path target/dist-libs \
|
--module-path target/dist-libs \
|
||||||
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec \
|
--add-modules javafx.controls,javafx.graphics,javafx.fxml,javafx.web,javafx.media,java.sql,java.net.http,jdk.crypto.ec,jdk.net \
|
||||||
--dest dist
|
--dest dist
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -285,7 +285,10 @@ final class On4KstConnectionManager {
|
|||||||
scheduler.schedule(
|
scheduler.schedule(
|
||||||
() -> sendLogin(token), LOGIN_FALLBACK_MILLIS,
|
() -> sendLogin(token), LOGIN_FALLBACK_MILLIS,
|
||||||
TimeUnit.MILLISECONDS);
|
TimeUnit.MILLISECONDS);
|
||||||
} catch (Exception exception) {
|
} catch (Throwable exception) {
|
||||||
|
// Errors must be caught as well: an Error escaping here would be
|
||||||
|
// swallowed by the scheduler and leave the state machine stuck in
|
||||||
|
// CONNECTING without any reconnect attempt or user visible failure.
|
||||||
try {
|
try {
|
||||||
socket.close();
|
socket.close();
|
||||||
} catch (IOException ignored) {
|
} catch (IOException ignored) {
|
||||||
@@ -699,7 +702,9 @@ final class On4KstConnectionManager {
|
|||||||
socket.setOption(ExtendedSocketOptions.TCP_KEEPIDLE, 45);
|
socket.setOption(ExtendedSocketOptions.TCP_KEEPIDLE, 45);
|
||||||
socket.setOption(ExtendedSocketOptions.TCP_KEEPINTERVAL, 15);
|
socket.setOption(ExtendedSocketOptions.TCP_KEEPINTERVAL, 15);
|
||||||
socket.setOption(ExtendedSocketOptions.TCP_KEEPCOUNT, 3);
|
socket.setOption(ExtendedSocketOptions.TCP_KEEPCOUNT, 3);
|
||||||
} catch (UnsupportedOperationException | IOException exception) {
|
} catch (UnsupportedOperationException | IOException | LinkageError exception) {
|
||||||
|
// LinkageError covers runtime images built without the jdk.net module;
|
||||||
|
// the connection stays usable, only kernel side keepalive is missing.
|
||||||
LOGGER.log(Level.INFO,
|
LOGGER.log(Level.INFO,
|
||||||
"Platform does not support configurable TCP keepalive; "
|
"Platform does not support configurable TCP keepalive; "
|
||||||
+ "application heartbeat remains active", exception);
|
+ "application heartbeat remains active", exception);
|
||||||
|
|||||||
Reference in New Issue
Block a user