This repository has been archived by the owner on Oct 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
use queue size to ensure history depth #31
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why check if the history kind is correct? Why not always set the
history.kind
to that and always set thehistory.depth
toqueue_size
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user has already configured a "better" history (e.g. keep all or a larger number) then the code should not reduce the history depth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would the user have had the chance to do that? The publisher was just created in this function. At best they could do it after the publisher is returned from this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is always possible to configure QoS parameters externally, e.g. via XML files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern is that if the default changes history kind then the queue size is not even set. Also, if I pass a queue size into this create function I would expect the queue is set to exactly what I asked, regardless of the default history settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to be able to fall back to system defaults, then we need a "create default publisher" option. I think it is the wrong behavior for the function to receive a
queue_size
and then potentially not use it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always setting the history kind and depth here would prevent using vendor specific configuration options completely.
The history kind only support ALL and DEPTH N. If the default has been set to ALL the function doesn't reduce the history. If it is set to a specific DEPTH it ensures that it has at least the requested queue size. But if the default has been changed to a larger value it is not reduced.
Imo if the user changes the default configuration he is doing that for a specific reason and I would not overwrite that choice in our code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ability to do that is an implementation detail, this function must behave consistently based on the input. I think that if I design my node to explicitly need a queue size of 1 and you set the global to keep all that will not work. If you want to use the defaults then we need a way to specify "use default", which is how it is modeled in DDS. We cannot ask users to always specify a queue_size and then potentially ignore it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have created ros2/rmw#13 to possibly extend the rmw interface to support both cases. Until then we will keep the behavior implemented in this PR.