Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

iox-#27 Add client and server port to PortPool and PortManager [stacked PR #2] #1084

Conversation

elBoberido
Copy link
Member

@elBoberido elBoberido commented Feb 9, 2022

Pre-Review Checklist for the PR Author

  1. Code follows the coding style of CONTRIBUTING.md
  2. Tests follow the best practice for testing
  3. Changelog updated in the unreleased section including API breaking changes
  4. Branch follows the naming format (iox-#123-this-is-a-branch)
  5. Commits messages are according to this guideline
    • Commit messages have the issue ID (iox-#123 commit text)
    • Commit messages are signed (git commit -s)
    • Commit author matches Eclipse Contributor Agreement (and ECA is signed)
  6. Update the PR title
    • Follow the same conventions as for commit messages
    • Link to the relevant issue
  7. Relevant issues are linked
  8. Add sensible notes for the reviewer
  9. All checks have passed (except task-list-completed)
  10. Assign PR to reviewer

Notes for Reviewer

This PR adds the client and server to the PortPool and PortManager. With this changes, the discovery loop is also updated to handle the new ports and it is taken care of resource cleanup.

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Code according to our coding style and naming conventions
  • Unit tests have been written for new behavior
    • Each unit test case has a unique UUID
  • Public API changes are documented via doxygen
  • Copyright owner are updated in the changed files
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

@elBoberido elBoberido added the enhancement New feature label Feb 9, 2022
@elBoberido elBoberido self-assigned this Feb 9, 2022
@elBoberido elBoberido force-pushed the iox-#27-add-client-and-server-port-to-port-pool-and-port-manager branch 3 times, most recently from 6677cc1 to c1dbf60 Compare February 10, 2022 12:46
@elBoberido elBoberido force-pushed the iox-#27-consolidate-port-queue-policies branch from dd30a28 to b17164e Compare February 10, 2022 13:40
@elBoberido elBoberido force-pushed the iox-#27-add-client-and-server-port-to-port-pool-and-port-manager branch from c1dbf60 to 265ef74 Compare February 10, 2022 13:40
@elBoberido elBoberido force-pushed the iox-#27-consolidate-port-queue-policies branch from b17164e to e4e90b6 Compare February 10, 2022 15:09
@elBoberido elBoberido force-pushed the iox-#27-add-client-and-server-port-to-port-pool-and-port-manager branch from 265ef74 to e35218f Compare February 10, 2022 15:10
@elBoberido elBoberido force-pushed the iox-#27-consolidate-port-queue-policies branch from e4e90b6 to c0894b5 Compare February 10, 2022 15:22
@elBoberido elBoberido force-pushed the iox-#27-add-client-and-server-port-to-port-pool-and-port-manager branch from e35218f to a9ddacd Compare February 10, 2022 15:22
@elBoberido elBoberido force-pushed the iox-#27-consolidate-port-queue-policies branch from c0894b5 to 84a0fe5 Compare February 10, 2022 16:26
@elBoberido elBoberido changed the title [do-not-review] iox-#27 Add client and server port to PortPool and PortManager [stacked PR #2] iox-#27 Add client and server port to PortPool and PortManager [stacked PR #2] Feb 10, 2022
@elBoberido elBoberido linked an issue Feb 10, 2022 that may be closed by this pull request
22 tasks
Copy link
Contributor

@elfenpiff elfenpiff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion we should add to every Log* message as much information as possible since we do not know what may becomes important during debugging.
Furthermore, I would suggest to always call LogError before calling the errorHandler to provide some context to the user. What do you think?

The rest looks fine - only minor things.

@@ -40,7 +40,7 @@ typedef struct
bool offerOnCreate;

/// @brief describes whether a publisher blocks when subscriber queue is full
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adjust the comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why, the comment is stil true. It's only the data type that changed it's name, note the member

iceoryx_binding_c/include/iceoryx_binding_c/runtime.h Outdated Show resolved Hide resolved
// delete client port from list after DISCONNECT was processed
m_portPool->removeClientPort(clientPortData);

LogDebug() << "Destroyed client port";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think it maybe helpful to add the process name and service description here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the process name is not available at this point, but I added the service description

/// @todo iox-#27 report to port introspection
if (!this->sendToAllMatchingServerPorts(caproMessage, clientPort))
{
LogDebug() << "capro::CONNECT/DISCONNECT, no matching server!!";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add the process name of the port owner and the service description? This goes also for all the other log messages.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, the process name is not available ... or did you mean the runtime name?

iceoryx_posh/source/roudi/port_manager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/source/roudi/port_pool.cpp Show resolved Hide resolved
iceoryx_posh/source/roudi/port_pool.cpp Show resolved Hide resolved
@elBoberido elBoberido force-pushed the iox-#27-add-client-and-server-port-to-port-pool-and-port-manager branch 2 times, most recently from 3c9d622 to 1a53faa Compare February 11, 2022 11:19
Base automatically changed from iox-#27-consolidate-port-queue-policies to master February 14, 2022 14:28
@elBoberido elBoberido force-pushed the iox-#27-add-client-and-server-port-to-port-pool-and-port-manager branch from 9372d15 to d10b138 Compare February 14, 2022 15:20
@codecov
Copy link

codecov bot commented Feb 14, 2022

Codecov Report

Merging #1084 (4a550b8) into master (d686972) will increase coverage by 0.14%.
The diff coverage is 82.06%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1084      +/-   ##
==========================================
+ Coverage   77.23%   77.38%   +0.14%     
==========================================
  Files         346      346              
  Lines       13159    13389     +230     
  Branches     1884     1917      +33     
==========================================
+ Hits        10164    10361     +197     
- Misses       2371     2395      +24     
- Partials      624      633       +9     
Flag Coverage Δ
unittests 76.62% <82.06%> (+0.14%) ⬆️
unittests_timing 12.20% <0.00%> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...include/iceoryx_posh/capro/service_description.hpp 100.00% <ø> (ø)
...ryx_posh/internal/popo/ports/client_port_roudi.hpp 100.00% <ø> (ø)
...ryx_posh/internal/popo/ports/server_port_roudi.hpp 100.00% <ø> (ø)
...clude/iceoryx_posh/internal/roudi/port_manager.hpp 100.00% <ø> (ø)
...oryx_posh/include/iceoryx_posh/roudi/port_pool.hpp 100.00% <ø> (ø)
iceoryx_posh/source/roudi/port_manager.cpp 80.53% <77.61%> (+0.11%) ⬆️
...ude/iceoryx_posh/internal/roudi/port_pool_data.inl 96.15% <100.00%> (ø)
iceoryx_posh/source/capro/service_description.cpp 98.03% <100.00%> (+0.08%) ⬆️
...ceoryx_posh/source/popo/ports/client_port_data.cpp 100.00% <100.00%> (ø)
...eoryx_posh/source/popo/ports/client_port_roudi.cpp 95.04% <100.00%> (+0.08%) ⬆️
... and 8 more

@elBoberido elBoberido force-pushed the iox-#27-add-client-and-server-port-to-port-pool-and-port-manager branch from 34bc993 to 3738316 Compare February 15, 2022 18:44
@elBoberido elBoberido force-pushed the iox-#27-add-client-and-server-port-to-port-pool-and-port-manager branch from 3738316 to 2b7e9f4 Compare February 16, 2022 17:49

// BEGIN ClientPort tests

TEST_F(PortPool_test, AddClientPortIsSuccessful)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not that happy with the naming but all tests in this file follow the same schema and this makes it easier to check if all ports have the same tests

@budrus budrus self-requested a review February 17, 2022 10:59
iceoryx_posh/source/roudi/port_manager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/source/roudi/port_manager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/source/roudi/port_manager.cpp Show resolved Hide resolved
iceoryx_posh/source/roudi/port_manager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/source/roudi/port_manager.cpp Outdated Show resolved Hide resolved
iceoryx_posh/source/roudi/port_manager.cpp Show resolved Hide resolved
@elBoberido elBoberido force-pushed the iox-#27-add-client-and-server-port-to-port-pool-and-port-manager branch 2 times, most recently from e8a28b5 to 1f4c22b Compare February 17, 2022 21:57
@elBoberido elBoberido force-pushed the iox-#27-add-client-and-server-port-to-port-pool-and-port-manager branch from a68ff3e to d2c13c1 Compare February 18, 2022 16:30
Copy link
Contributor

@elfenpiff elfenpiff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please substitute elfenpiff with budrus :D

iceoryx_posh/test/moduletests/test_capro_service.cpp Outdated Show resolved Hide resolved
@elBoberido elBoberido force-pushed the iox-#27-add-client-and-server-port-to-port-pool-and-port-manager branch from d2c13c1 to 4a550b8 Compare February 18, 2022 18:17
@elBoberido elBoberido merged commit ca6fa0f into master Feb 20, 2022
@elBoberido elBoberido deleted the iox-#27-add-client-and-server-port-to-port-pool-and-port-manager branch February 20, 2022 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request/Response communication with iceoryx
3 participants