-
Notifications
You must be signed in to change notification settings - Fork 243
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
[SDL-0189] Restructuring OnResetTimeout #3726
[SDL-0189] Restructuring OnResetTimeout #3726
Conversation
…quest Controller interface.
…eate Request Controller interface.
[SDL-0189] Fix onResetTimeout twice notification
…e_alert_with_soft_buttons [SDL-0189] Restrict timeout for subtle alert with soft buttons
[SDL-0189] fix crash sdl_core on close
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.
Thanks for the PR, i have left some review comments. Also, can you please confirm if BC.OnResetTimeout
is applicable to all RPCs including Alert
, DialNumber
, SubtleAlert
etc.? Or do we have specific requirements barring that? I noticed that there are some tests in atf test scripts designed to ignore OnResetTimeout
for these RPCs.
* requests. | ||
*/ | ||
class RequestController { | ||
class RequestControllerImpl : public RequestController { |
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.
Please add all the deleted comments as applicable.
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.
@atiwari9 please note that RequestControllerImpl
is now just a class containing public functions overridden from the interface class. We don't need to duplicate the description of such functions in the impl classes according to our coding style:
https://google.github.io/styleguide/cppguide.html#Function_Comments
When documenting function overrides, focus on the specifics of the override itself, rather than repeating the comment from the overridden function. In many of these cases, the override needs no additional documentation and thus no comment is required.
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.
@AKalinich-Luxoft , @ychernysheva - Please let me know when the PR is ready to be reviewed after above mentioned changes.
@@ -45,7 +45,10 @@ RCGetInteriorVehicleDataConsentRequest::RCGetInteriorVehicleDataConsentRequest( | |||
params.application_manager_, | |||
params.rpc_service_, | |||
params.hmi_capabilities_, | |||
params.policy_handler_) {} | |||
params.policy_handler_) { |
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.
Shouldn't this be read from smartDeviceLink.ini config file. Why is this timeout doubled?
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.
@atiwari9
Yes, initially default timeout value is taken from the SDL config file for all command requests:
, default_timeout_(application_manager.get_settings().default_timeout()) |
Later, some particular commands are adjusting the default timeout according to their internal needs.
In this case, timeout is doubled to give HMI extra time for showing user consent prompt popup (which is another +10 seconds) - please look at linked issue #2829 for more details and sequence diagram.
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 understand that this may have been used as a work around earlier, when HMI probably didn't have a way to reset the timeout on SDL side, now it does. So we really don't and shouldn't still add such patches in SDL. If this is done to maintain the legacy implementation, i understand. But even in that case please log a bug/improvement item so that the onus can now be shifted back to HMI. After all, that's the whole point of enabling HMI to reset timeout for RPCs.
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.
@atiwari9 ok, I think we can remove all these timeout adjustments from existing PR and rely on HMI to control the lifetime of corresponding requests properly. In that case, we need the following changes:
- Remove timeout adjustment changes from affected SDL core requests
- Update the same requests on the HMI side - if HMI notices that extra time from the user is required then HMI sends OnResetTimeout to SDL with a doubled timeout value so SDL can wait for enough time
- Check with ATF scripts that updated implementation does not break the legacy code and feature works as expected
Please let me know, is that plan works for you?
@@ -54,6 +54,21 @@ ButtonPressRequest::ButtonPressRequest( | |||
|
|||
ButtonPressRequest::~ButtonPressRequest() {} | |||
|
|||
bool ButtonPressRequest::Init() { |
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.
Again, this should be HMI's responsibility. Why are we changing timeout in SDL?
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.
@atiwari9
SDL should understand from its side whether the mobile request expired (and respond with GENERIC_ERROR
) or HMI is still working on it. The reason for changing the timeout is the same as in the previous comment.
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.
Please see comment: #3726 (comment)
@@ -54,6 +54,22 @@ SetInteriorVehicleDataRequest::SetInteriorVehicleDataRequest( | |||
|
|||
SetInteriorVehicleDataRequest::~SetInteriorVehicleDataRequest() {} | |||
|
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.
Same comment as above. this should be HMI's responsibility. Why are we changing timeout in SDL?
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.
@atiwari9
SDL should understand from its side whether the mobile request expired (and respond with GENERIC_ERROR
) or HMI is still working on it. The reason for changing the timeout is the same as in the previous comment.
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.
@atiwari9 it's hard to simply say yes or no here. Basically, More details and references will be provided for all these requirements in atf test scripts PR |
@ychernysheva - Also can you please log a bug for the case where Alert response is still ABORTED when TTS.Alert timeout is reset and UI.Alert finishes. Ideally it should wait for both UI and TTS Alert timeouts to be complete. |
@atiwari9 I don't think this is a bug. It's a part of the existing SDL logic - in case if SDL receives a response from HMI on the UI part but the TTS part is still in progress, then SDL sends |
Thinking further on it, i think the scenario where user has dismissed the Alert while TTS was playing does count as |
* Do not manage requests with NULL timeout
…ut_remove_default_timeout_adjustments Remove default timeout adjustments from core
@atiwari9 core changes according to comment #3726 (comment) have been added in f27c548 and fd71265 |
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.
Aprproved.
@theresalech This PR is ready for Livio review. Thank you! |
src/components/application_manager/include/application_manager/application_manager_impl.h
Outdated
Show resolved
Hide resolved
src/components/application_manager/include/application_manager/application_manager_impl.h
Show resolved
Hide resolved
src/components/application_manager/include/application_manager/application_manager_impl.h
Show resolved
Hide resolved
src/components/application_manager/include/application_manager/commands/command_request_impl.h
Outdated
Show resolved
Hide resolved
src/components/application_manager/include/application_manager/request_controller_impl.h
Outdated
Show resolved
Hide resolved
src/components/application_manager/include/application_manager/request_timeout_handler_impl.h
Show resolved
Hide resolved
@ShobhitAd all comments have been processed. Could you please proceed with your review here? |
@AKalinich-Luxoft Hello, With these changes In order to handle the time the message spends on the wire (in transport), in a message queue, and finally being processed I propose we add some additional time to these timers, ideally configurable from the INI. At the moment these |
Update default timeout logic accordingly for all commands. Added new file to ini file.
@iCollin all changes have been implemented in 031c65f |
src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc
Outdated
Show resolved
Hide resolved
...application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc
Outdated
Show resolved
Hide resolved
@AKalinich-Luxoft thank you for addressing the review comments. Please resolve the merge conflicts on the PR |
@ShobhitAd done |
@AKalinich-Luxoft a small comment regarding the rpc_spec commit change. |
@ShobhitAd fixed in c011a9c |
Fixes #2422
Also fixes known issue #2829
This PR is ready for review.
Risk
This PR makes major API changes.
Testing Plan
Summary
Expand OnResetTimeout RPC for all interfaces.
Note: SDL will apply OnResetTimeout only in case when resetPeriod value is greater than the time remaining from the current timeout
Changelog
Breaking Changes
CLA