Skip to content
New issue

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

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

Already on GitHub? # to your account

SDL must close only session in case mobile app does not answer on Heartbeat_request #1893

Closed
6 of 9 tasks
LitvinenkoIra opened this issue Nov 23, 2017 · 7 comments
Closed
6 of 9 tasks

Comments

@LitvinenkoIra
Copy link
Contributor

LitvinenkoIra commented Nov 23, 2017

Occurrence:

Always

Steps to reproduce:

  1. Reduce default value for Heartbeat timeout in SDL .INI file to 5 sec.
  2. Start SDL
  3. Start HMI
  4. Connect mobile device
  5. Register mobile application (sending of Heartbeat from application is switched off)
  6. Wait 15 seconds
  7. Check that app is unregistered
  8. Check that mobile connection is still alive

Expected result:

Mobile connection is still alive and it's possible to create new mobile session

Actual result:

Mobile connection is closed

Environment:

Test script:

1893_ATF_HeartBeat_App_does_not_send_HB_and_does_not_respond.lua

Expected delivery

  • Source code updates
  • Code comments
  • UTs add/update (not required)
  • ATF tests add/update
  • Manual tests (not required)
  • Add/update CI plans/jobs (not required)
  • SDD updates (not required)
  • Guidelines update (sdl_core_guides) (not required)
  • Guidelines update (sdl_hmi_integration_guidelines) (not required)
@aderiabin
Copy link

Contributor priority is set High with reason: The issue is related to connection/session logic
Mobile applications should work independently one from other.

@LitvinenkoIra
Copy link
Contributor Author

Works correctly on current develop (8c94933)
Script for verifying and testing report 1893.tar.gz

@Itileda Itileda reopened this Dec 8, 2017
@LuxoftAKutsan
Copy link
Contributor

@jacobkeeler @JackLivio please close the issue.

@LuxoftAKutsan
Copy link
Contributor

LuxoftAKutsan commented Dec 14, 2017

HeartBeatMonitor is in charge of monitoring heartbeat timeout. There is separate HeartBeatMonitor for each connection.
It has separate own thread that executing HeartBeatMonitor::Process function.
HeartBeatMonitor handles session numbers and monitors heartbeat for each session :

class HeartBeatMonitor : public threads::ThreadDelegate {
...
  HeartBeatMonitor(uint32_t heartbeat_timeout_mseconds, Connection* connection);

  void AddSession(uint8_t session_id);
  void RemoveSession(uint8_t session_id);
...
void HeartBeatMonitor::Process() {
  sessions_list_lock_.Acquire();
  SessionMap::iterator it = sessions_.begin();
  while (it != sessions_.end()) {
  ...

And in case if Hearbeat timeout elapsed HeartBeatMonitor will close certain session :

void HeartBeatMonitor::Process() {
...
    if (state.HasTimeoutElapsed()) {
      const uint8_t session_id = it->first;
      if (state.IsReadyToClose()) {
        LOG4CXX_WARN(logger_, "Will close session");
        sessions_list_lock_.Release();
        RemoveSession(session_id);
        connection_->CloseSession(session_id);
        sessions_list_lock_.Acquire();
...
}

@dboltovskyi
Copy link
Contributor

dboltovskyi commented Dec 20, 2017

There is some extension for the initial requirement:
SDL should not close mobile connection even if last session on this connection had been closed.

Currently on a head of develop (0b19cf4) SDL close such connection, so issue is reproduced.

Description of the issue is updated.
Test script is also updated accordingly.

@mrapitis
Copy link
Contributor

Requires additional testing with the updated script that is provided.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

9 participants