Title: Unsubscribe from topic safely · Issue #105 · ros2-java/ros2_java · GitHub
Open Graph Title: Unsubscribe from topic safely · Issue #105 · ros2-java/ros2_java
X Title: Unsubscribe from topic safely · Issue #105 · ros2-java/ros2_java
Description: Currently, there is no safe way to unsubscribe from a topic. If the user calls dispose() on a Subscription, then it will destroy the native subscription (effectively unsubscribing), but the Node is not aware of the subscriptions disposal...
Open Graph Description: Currently, there is no safe way to unsubscribe from a topic. If the user calls dispose() on a Subscription, then it will destroy the native subscription (effectively unsubscribing), but the Node is...
X Description: Currently, there is no safe way to unsubscribe from a topic. If the user calls dispose() on a Subscription, then it will destroy the native subscription (effectively unsubscribing), but the Node is...
Opengraph URL: https://github.com/ros2-java/ros2_java/issues/105
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unsubscribe from topic safely","articleBody":"Currently, there is no safe way to unsubscribe from a topic. If the user calls `dispose()` on a `Subscription`, then it will destroy the native subscription (effectively unsubscribing), but the `Node` is not aware of the subscriptions disposal. E.g. [getSubscriptions](https://github.com/ros2-java/ros2_java/blob/1190aeb909e051e79b2b43325f924f42e5c96160/rcljava/src/main/java/org/ros2/rcljava/node/NodeImpl.java#L227-L229) will return disposed subscriptions that may be [accessed by executors](https://github.com/ros2-java/ros2_java/blob/1190aeb909e051e79b2b43325f924f42e5c96160/rcljava/src/main/java/org/ros2/rcljava/executors/BaseExecutor.java#L170) leading an exception:\r\n\r\n org.ros2.rcljava.exceptions.RCLException: Failed to add subscription to wait set\r\n\r\nI think we need a way to safely remove `Subscription` (and `Publisher`) objects from a node. Whether that is through the existing `Disposable` interface or API added to the node (e.g. `removeSubscription`).\r\n\r\n## Implementation considerations\r\n\r\nI think having the node detect when a subscription has been disposed (perhaps using [WeakReference](https://docs.oracle.com/javase/7/docs/api/java/lang/ref/WeakReference.html)) would be nice as I don't think it would require additional API. ","author":{"url":"https://github.com/jacobperron","@type":"Person","name":"jacobperron"},"datePublished":"2020-05-01T17:46:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/105/ros2_java/issues/105"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8d509515-648d-6ab6-5e41-07840e044ef0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9246:150591:A24DC8:D21B0C:698017A3 |
| html-safe-nonce | 7bb6039643cdcba6b897153d681cdbdd5c7a28dbf5b351f0fb105a8204f7c89d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjQ2OjE1MDU5MTpBMjREQzg6RDIxQjBDOjY5ODAxN0EzIiwidmlzaXRvcl9pZCI6IjIxNDg5NjI2MDg4NzM0NzgwNTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e2be16a3e7b105f105f25591eda806c59c90dba0ff9c103c2c3647a7ded9e380 |
| hovercard-subject-tag | issue:610877659 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ros2-java/ros2_java/105/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3cf450c43ffee313ccf10cdef4a3ed003b10cec0b6135c570dab272b0c9c5cb1/ros2-java/ros2_java/issues/105 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3cf450c43ffee313ccf10cdef4a3ed003b10cec0b6135c570dab272b0c9c5cb1/ros2-java/ros2_java/issues/105 |
| og:image:alt | Currently, there is no safe way to unsubscribe from a topic. If the user calls dispose() on a Subscription, then it will destroy the native subscription (effectively unsubscribing), but the Node is... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jacobperron |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/ros2-java/ros2_java git https://github.com/ros2-java/ros2_java.git |
| octolytics-dimension-user_id | 23436176 |
| octolytics-dimension-user_login | ros2-java |
| octolytics-dimension-repository_id | 52850323 |
| octolytics-dimension-repository_nwo | ros2-java/ros2_java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 52850323 |
| octolytics-dimension-repository_network_root_nwo | ros2-java/ros2_java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width