Skip to content
New issue

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

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

Already on GitHub? # to your account

Question about client genertated by Service donnot disconnected when node exit #567

Closed
byebaibai opened this issue Oct 5, 2022 · 2 comments
Labels

Comments

@byebaibai
Copy link

Description

  • Library Version: 1.3.0
  • ROS Version: Foxy
  • Platform / OS: Ubuntu 20.04.5 LTS

Steps To Reproduce

setInterval(function () {
  var statusRos = new ROSLIB.Ros();
  statusRos.connect(that.$rosBackendUrl);
  statusRos.getNodes(async function (nodes) {
    for(var ni in nodes) {
      const device_status_client = new ROSLIB.Service({
        ros: statusRos,
        name: "foo/get_device_status",
        serviceType: 'std_srvs/Empty'
      })
      async function getStatus() {
        return new Promise((resolve, reject) => {
          device_status_client.callService(
            new ROSLIB.ServiceRequest({}), 
            device => {
              // Do something
              resolve();
            },
            error => {
              reject(error);
              console.error(error);
            }
          );
        })
      }
      try {
        await getStatus();
      } catch( err ){
        console.error(err);
      }
    }
  }
  await statusRos.close();
}, 1000);

Expected Behavior
When using kill -2 {NODE_PID} to exit one node, the client caused by callService should be disconnected to the rosbridge_websocket, and the number of clients connected to the rosbridge_websocket should be minus one.

Actual Behavior
When using kill -2 {NODE_PID} to exit one node, the client caused by callService seems not to be disconnected to the rosbridge_websocket, and the number of clients connected to the rosbridge_websocket should hold the same.

@byebaibai byebaibai added the bug label Oct 5, 2022
@MatthijsBurgh
Copy link
Contributor

@byebaibai could you create a running example?

@MatthijsBurgh
Copy link
Contributor

The ROS object is disconnecting. Not the topics/service. So something else is going wrong.

k-aguete pushed a commit to k-aguete/roslibjs that referenced this issue Oct 21, 2022
Bumps [marked](https://github.com/markedjs/marked) from 0.8.2 to 4.1.0.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](markedjs/marked@v0.8.2...v4.1.0)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@MatthijsBurgh MatthijsBurgh closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants