Skip to content

Impl req/res delay config for subscribe/offer msg #870

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thangarajpvaleo
Copy link

Description

In the original implementation,

  • the existing configuration "request_response_delay" is never used without a way to give a min and a max value.

Motivation for this change:

  • Scenario-1:

    • The client node's sd response [Subscribe] for an offer is fast where offer node can't handle the subscription request
      and no SubcribeAck is sent.
    • Due to the difference in SD response speed between the nodes, the client node keep sending StopSubscribe/Subscribe and Negative ACK.
    • To address this, subscriber had to delay it's SD response, so as to match the offer node.
  • Scenario-2:

    • When the client node find's the offer node, response delay for the offer node can be configured.

Changes that we have done:

  • Added configuration 'request_response_delay_min' and 'request_response_delay_max'

  • Added a async_sender class.

  • The async_sender class manages a priority queue of packets with associated timeouts,

  • using a worker thread to monitor and trigger callbacks for sending when timeouts expire.

  • It provides methods for starting and stopping the worker thread, adding packets to the queue, and setting the callback interface. This enables asynchronous packet sending with timeout management, avoiding blocking the main application thread.

  • Changes in Service Discovery Impl class :

    • Added handling of service subscriptions, and offers, and sending these messages asynchronously with managed timeouts using an async_sender class.
    • Additionally, it tracks pending messages to prevent redundant transmissions.
  • Some assumptions with respect to service discovery configuration values:

    • 'request_response_delay_max' will be less than 'ttl', 'cyclic_offer_delay' and 'repetitions_base_delay'

    references:

    [PRS_SOMEIPSD_00420]
    - REQUEST_RESPONSE_DELAY shall be specified by a minimum and a maximum.

    [PRS_SOMEIPSD_00421]
    - The actual delay shall be randomly chosen between minimum and maximum of REQUEST_RESPONSE_DELAY.

Validation:

  • verified on two ubuntu pc's with the sample notify/subscribe application.

@thangarajpvaleo
Copy link
Author

Hi Covesa, May i know the status of this pull request. Please update, Thanks.

@duartenfonseca
Copy link
Collaborator

hi @thangarajpvaleo could you fix the conflicts?

@thangarajpvaleo
Copy link
Author

@duartenfonseca resolved the conflicts, please check. Thanks

thangarajpvaleo

This comment was marked as duplicate.

@vidz12
Copy link

vidz12 commented Jun 11, 2025

Is this going to be merged? @duartenfonseca

@thangarajpvaleo
Copy link
Author

Hi @duartenfonseca/Covesa , May i know the status of this pull request. Please update, Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants