Bug #2776

Synchronized send is still blocking after remote server is deactivated.

Added by M. Pohling over 1 year ago. Updated 7 months ago.

Status:ResolvedStart date:10/17/2018
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Java
Target version:rsb-0.18

Description

error Synchronized send is still blocking (until timeout) after remote server is deactivated. Would be nice if the send is interrupted to improve the system shutdown.

setup spread configured via global config file and started.

test code

public static void main(String[] args) {
    RemoteServer remote = Factory.getInstance().createRemoteServer("/test/scope");

    System.out.println("activate");
    try {
        remote.activate();
    } catch (RSBException e) {
        e.printStackTrace();
    }

    System.out.println("trigger server task");
    new Thread(() -> {
        try {
            remote.call("mymethod");
        } catch (RSBException | ExecutionException | TimeoutException | InterruptedException e) {
            e.printStackTrace();
        }
    }).start();
    try {
        Thread.sleep(1000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    System.out.println("deactivate");
    try {
        if (remote.isActive()) {
            remote.deactivate();
        }
    } catch (RSBException | InterruptedException e) {
        e.printStackTrace();
    }

    System.out.println("done");
}

output
/usr/lib/jvm/default-java/bin/java -Dvisualvm.id=397144975021476 -javaagent:/home/divine/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/182.4892.20/lib/idea_rt.jar=39768:/home/divine/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/182.4892.20/bin -Dfile.encoding=UTF-8 -classpath /usr/lib/jvm/default-java/jre/lib/charsets.jar:/usr/lib/jvm/default-java/jre/lib/deploy.jar:/usr/lib/jvm/default-java/jre/lib/ext/cldrdata.jar:/usr/lib/jvm/default-java/jre/lib/ext/dnsns.jar:/usr/lib/jvm/default-java/jre/lib/ext/jaccess.jar:/usr/lib/jvm/default-java/jre/lib/ext/jfxrt.jar:/usr/lib/jvm/default-java/jre/lib/ext/localedata.jar:/usr/lib/jvm/default-java/jre/lib/ext/nashorn.jar:/usr/lib/jvm/default-java/jre/lib/ext/sunec.jar:/usr/lib/jvm/default-java/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/default-java/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/default-java/jre/lib/ext/zipfs.jar:/usr/lib/jvm/default-java/jre/lib/javaws.jar:/usr/lib/jvm/default-java/jre/lib/jce.jar:/usr/lib/jvm/default-java/jre/lib/jfr.jar:/usr/lib/jvm/default-java/jre/lib/jfxswt.jar:/usr/lib/jvm/default-java/jre/lib/jsse.jar:/usr/lib/jvm/default-java/jre/lib/management-agent.jar:/usr/lib/jvm/default-java/jre/lib/plugin.jar:/usr/lib/jvm/default-java/jre/lib/resources.jar:/usr/lib/jvm/default-java/jre/lib/rt.jar:/home/divine/local_data/workspace/openbase/bco/module/jul/extension/rsb/com/target/classes:/home/divine/local_data/workspace/openbase/bco/module/jul/extension/rst/interface/target/classes:/home/divine/local_data/.m2/repository/rsb/rst/0.18-SNAPSHOT/rst-0.18-20180206.145148-16.jar:/home/divine/local_data/.m2/repository/rsb/rst-sandbox/0.18-SNAPSHOT/rst-sandbox-0.18-20180206.145155-16.jar:/home/divine/local_data/.m2/repository/rsb/rst-experimental/0.18-SNAPSHOT/rst-experimental-0.18-20181011.150504-30.jar:/home/divine/local_data/workspace/openbase/bco/module/jul/extension/rst/util/target/classes:/home/divine/local_data/workspace/openbase/bco/module/jul/extension/rsb/interface/target/classes:/home/divine/local_data/workspace/openbase/bco/module/jul/exception/target/classes:/home/divine/local_data/workspace/openbase/bco/module/jul/extension/rsb/scope/target/classes:/home/divine/local_data/workspace/openbase/bco/module/jul/extension/rst/processing/target/classes:/home/divine/local_data/workspace/openbase/bco/module/jul/extension/protobuf/target/classes:/home/divine/local_data/workspace/openbase/bco/module/jul/processing/target/classes:/home/divine/local_data/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.7.5/jackson-core-2.7.5.jar:/home/divine/local_data/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.7.5/jackson-databind-2.7.5.jar:/home/divine/local_data/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.7.0/jackson-annotations-2.7.0.jar:/home/divine/local_data/.m2/repository/com/googlecode/protobuf-java-format/protobuf-java-format/1.4/protobuf-java-format-1.4.jar:/home/divine/local_data/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/home/divine/local_data/.m2/repository/java3d/vecmath/1.3.1/vecmath-1.3.1.jar:/home/divine/local_data/.m2/repository/com/google/code/gson/gson/2.6.2/gson-2.6.2.jar:/home/divine/local_data/workspace/openbase/bco/module/jul/interface/target/classes:/home/divine/local_data/workspace/openbase/bco/module/jul/annotation/target/classes:/home/divine/local_data/workspace/openbase/bco/module/jul/schedule/target/classes:/home/divine/local_data/workspace/openbase/bco/module/jul/pattern/default/target/classes:/home/divine/local_data/.m2/repository/rsb/rsb/0.18-SNAPSHOT/rsb-0.18-20180913.092653-31.jar:/home/divine/local_data/.m2/repository/com/google/protobuf/protobuf-java/2.6.1/protobuf-java-2.6.1.jar:/home/divine/local_data/.m2/repository/com/github/jnr/jnr-ffi/2.0.9/jnr-ffi-2.0.9.jar:/home/divine/local_data/.m2/repository/com/github/jnr/jffi/1.2.11/jffi-1.2.11.jar:/home/divine/local_data/.m2/repository/com/github/jnr/jffi/1.2.11/jffi-1.2.11-native.jar:/home/divine/local_data/.m2/repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar:/home/divine/local_data/.m2/repository/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.jar:/home/divine/local_data/.m2/repository/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar:/home/divine/local_data/.m2/repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar:/home/divine/local_data/.m2/repository/org/ow2/asm/asm-util/5.0.3/asm-util-5.0.3.jar:/home/divine/local_data/.m2/repository/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar:/home/divine/local_data/.m2/repository/org/openbase/jps/3.4.9/jps-3.4.9.jar:/home/divine/local_data/.m2/repository/org/fusesource/jansi/jansi/1.17.1/jansi-1.17.1.jar:/home/divine/local_data/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/home/divine/local_data/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/home/divine/local_data/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:/home/divine/local_data/.m2/repository/commons-io/commons-io/2.5/commons-io-2.5.jar org.openbase.jul.extension.rsb.com.RSBTest
activate
trigger server task
deactivate
Oct 17, 2018 3:13:09 PM rsb.introspection.IntrospectionParticipantObserver destroyed
INFO: Deactivating introspection protocol handler since no more participants exist
done
java.util.concurrent.TimeoutException
    at rsb.patterns.Future.get(Future.java:173)
    at rsb.patterns.RemoteServer.call(RemoteServer.java:226)
    at rsb.patterns.RemoteServer.call(RemoteServer.java:192)
    at rsb.patterns.RemoteServer.call(RemoteServer.java:251)
    at org.openbase.jul.extension.rsb.com.RSBTest.lambda$main$0(RSBTest.java:52)
    at java.lang.Thread.run(Thread.java:748)

Process finished with exit code 0


Related issues

Related to Robotics Service Bus - Bug #2777: Async send future is not canceled after remote server is ... Resolved 10/17/2018

History

#1 Updated by J. Wienke over 1 year ago

  • Related to Bug #2777: Async send future is not canceled after remote server is deactivated. added

#2 Updated by J. Moringen 7 months ago

  • Status changed from New to Resolved

Improved in master branch.

Also available in: Atom PDF