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

[BUG]: Service available event is always missing after release_service() and request_service() again #830

Open
zhaoxin39913 opened this issue Dec 30, 2024 · 1 comment
Labels

Comments

@zhaoxin39913
Copy link

zhaoxin39913 commented Dec 30, 2024

vSomeip Version

v3.4.10

Boost Version

1.7.6

Environment

Ubuntu 20.04

Describe the bug

Hi vsomeip team,

There is a critical issue during our customer integration test, and after a lot of log investigation and debugging we have confirmed the issue is because the available event is missing after release_service() and request_service().

In our reproduction test, there are two vsomeip apps running on two devices. Server app is always offering a service (eg. 0x238/0x1) continuously , client app then requests that service and registers availability handler. The first time the availability handler in the client app is triggered with "AVAILABLE=true" correctly. However next if client app calls release_service(0x238/0x1) and waits for 2-3 seconds, then calls requst_service(0x238/0x1) again, the availability handler is first triggered with "AVAILABLE=false" but the "AVAILABLE=true" is never triggered aftewards unless we restart the server app or client app, even we found the client socket is already established(confirmed via "netstat" command).

You can 100% reproduce the issue with below code logic(assume the server app is offering service (0x238/0x1) all the time):

#define SERVICE_ID 0x238
#define INSTANCE_ID 0x1

// Request service and register availability handler.
app->request_service(SERVICE_ID, INSTANCE_ID);
app->register_availability_handler(SERVICE_ID, INSTANCE_ID, availability_handler);

// Wait for a few seconds
std::this_thread::sleep_for(std::chrono::seconds(3));

// After AVAILABLE=true is triggered then call release_service(). 
app->unregister_availability_handler(SERVICE_ID, INSTANCE_ID);
app->release_service(SERVICE_ID, INSTANCE_ID);

// Wait for a few seconds
std::this_thread::sleep_for(std::chrono::seconds(3));

// Re-register the service
app->request_service(SERVICE_ID, INSTANCE_ID);
app->register_availability_handler(SERVICE_ID, INSTANCE_ID, availability_handler);

// Till here, the availability handler is triggered with "AVAILABLE=false", 
// but the "AVAILABLE=true" is never coming, unless we restart the server app or client app

Reproduction Steps

No response

Expected behaviour

No response

Logs and Screenshots

No response

@zhaoxin39913
Copy link
Author

Tested both availability handler types, which have the same issue.

typedef std::function< void (service_t, instance_t, bool) > availability_handler_t;
typedef std::function< void (service_t, instance_t, availability_state_e) > availability_state_handler_t;

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

No branches or pull requests

1 participant