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

vSomeIP 3.5.3 #802

Merged
merged 23 commits into from
Nov 28, 2024
Merged

vSomeIP 3.5.3 #802

merged 23 commits into from
Nov 28, 2024

Conversation

duartenfonseca
Copy link
Collaborator

@duartenfonseca duartenfonseca commented Nov 8, 2024

Revert fix compile issue with pthreads in android commit (f55505c)
Revert Force abort hanging detached threads commit (0ab85df)
Remove dead code path
Add timeout for detached threads
Update wireshark dissector
fix race condition on boost async operations
Enabled initial event tests
Add vsomeip config parsing
Whitelist initial events tests
Adds on_register_application_ack
Suspend resume tests fix
add service and method ids to the clients_ array
Fix capturing references to stack variables
Protects receiver_ and lock to routing stop function
Add include unordered map
Add remove local in deregistration(rmi)
protect deserialization from malicious input
Ignore send_cbk if the socket is not connected
Move suspend/resume of endpoints
Change handling of availabilities for wildcasts
Allow to configure the initial routing state
Enable subscription expiration

Details
Avoid gcovr to throw an error for suspicious_hits warning
Ana Rodrigues and others added 21 commits November 27, 2024 16:55
Revert Fix compile issue with pthreads in android commit
Revert Force abort hanging detached threads commit

The commits related to the shutdown cause crashes.
Summary
Add timeout for detached threads to stop executing durring app->stop()
Details
Semaphore-like logic is kept to check the status of detached threads during app->stop()
If check timeout is reached it logs a warning message and proceeds with normal shutdown
The default timeout is 3 seconds
Summary
Adds parsing to the routing_info command wireshark dissector
Details
The wireshark vsomeip dissector will now also parse the payload
of the routing_info command entries.
It will display the information of the subcommands:
add_client, del_client, add_service and del_service.
Adds also parsing for the request service and fixes the assign client name.
Summary
Fix race condition when boost async operations are executed
Summary
Fix core dump back traces.
Added some improves in initial event test client.

Details
Issue with initial_event_stop_service: The application tries to send a message,
and then starts the deregister process.
The issue occurs when the routing manager received the deregister request
before forwarding the message sent by the application. The issue was solved
with a small sleep after the application sent the message.
Summary
Adds the VSOMEIP_CONFIG command payload parsing.
Details
The wireshark vsomeip dissector will now also parse the payload
of the VSOMEIP_CONFIG command.
It will display the information of the key and value.
Additionally, a hint is added in the documentation referring to the
magical number prologue and epilogue contained in vsomeip packet payload.
Summary
REGISTER_APPLICATION_ACK command will now validate past requests.
Local tcp connections are now limited to 2 retries instead of being unlimited.
Details
After receiving the REGISTER_APPLICATION_ACK command the routing
host will now check if the client has previously request services.
This will be specially needed in cases where, after/during a suspend,
a local tcp client loses its connection. When re registering successfully,
the host will check the requests.
The host will send new routing infos with the services to notify the client
of its availabilities/unavailabilities.
the local_tcp endpoints will now follow a similiar logic of the local_uds
endpoints on re connect attempts.
Before this was unlimited, and the client endpoints could be stuck in a
forever loop trying to reconnect to applications that would never return.
Now they will have 2 re attemps before closing.
The only exception is the connection between client to routing host,
this one still needs to keep on retrying.
Summary
Suspend resume tests now starts "runner" thread after app->init
Details
The goal of the changes in this PR is to move the start of the "runner"
thread in which the app->start runs from the initialization list of the
suspend_resume_test_service and only start the thread after the app init.
The problem that lead to this change was that for some reason, the "runner"
thread although it should start when the test starts, very often it only started
after the "start" function of the test that runs the app->init. This is a problem
since when the "runner" thread starts, it locks a mutex and waits a condition
variable to be notified to then run the app->start, and the "start" function is
the one that notifies the condition variable after running the app->init. What
was happening was that the "runner" thread did not start at the beginning of
the test, the "start" function would notify the condition variable and only then
the "runner" thread would start and wait for the condition variable to be
notified, which never happened since the condition variable was notified
before the "runner" thread started, leading to a timeout.
To fix this issue, I removed the initialization of the "runner" thread away
from the initialization list and only initialized it after the app->init was run,,
without using condition variables to guarantee that the app->start happens
after the app->init. Before this fix the issue would occur very frequently
(>50% of runs) on a VM with roughly the same resources as zuul, and with
this fix it never failed again locally.
Summary
Add service and method to the clients_ array so it is possible to process 2 requests with the same client and session
Details
Add service and method to the clients_ array so it is possible to process 2 requests with the same client and session
Summary
Protects member variable receiver_, adds nullptr checks and locker to routing stop function
Details
New mutex is created for receiver_ member variable (as we have done with sender_). The receiver_ is now thread safe.
Adds extra nullptr checks and new lock for the routing stop function for proper synchronization among the threads.
The routing_stop_mutex_ is created to prevent other actions from occurring while ::stop() is being executed.
For example, this prevents actions like network changes or assigning the client during the stop operation.
You will observe this mutex being used in ::on_net_state_change and ::on_message.
Specifically, it is utilized in the ASSIGN_CLIENT_ACK_ID condition to ensure proper sync during these operations.
Summary
Add include of unordered map
Details
To fix a problem in a previous PR where unordered map
was used without including unordered map, unordered map
was now included in the appropriate file
Summary
Fixes possible DOS.
Details
Prevent vector allocation with invalid length during option deserialization.
Return early if the user-supplied length value is zero to avoid exceptions.
Summary
Ignore send_cbk if the socket is not connected
Details
Possible race condition during connect_cbk and send_cbk,
causes the endpoint to stop attempting to reconnect.
In the case where the socket is not yet connected, or connecting,
the send_cbk should do nothing.
Summary
Move suspend/resume of endpoints
Details

Suspend endpoints as the last action when suspending
Resume endpoints as the first action when resuming
Check the target state of the endpoints after suspending/resuming them
Summary
Change handling of availabilities for wildcasts (ANY_SERVICE, ANY_INSTANCE)
Details
Do _NOT report the state of the wildcard (there cannot be any consistent state),
but report the available instances instead.
Summary
Allow to configure the initial routing state to allow suspended startup
Details
Add a configuration parameter service-discovery.initial_state to allow the configuration of the behavior
on startup. Additionally, ensure that new endpoints that are created while the routing is suspended are
not started. This will happen on the next resume.
Summary
Allow subscriptions to expire when a reboot or ttl timeout is detected
Details

set_noned() function created in remote_subscription.cpp
added set_noned() at the end of routing_manager_impl::on_remote_subscribe
to reset the set_forwarded to allow subscriptions to expire in case of
reboot and ttl timeout.
@duartenfonseca duartenfonseca force-pushed the vsomeip_3.5.3 branch 2 times, most recently from 2638cb5 to 74bc25d Compare November 27, 2024 17:11
@duartenfonseca duartenfonseca marked this pull request as ready for review November 27, 2024 17:14
Changes:
Revert fix compile issue with pthreads in android commit
Revert Force abort hanging detached threads commit
Remove dead code path
Add timeout for detached threads
Update wireshark dissector
fix race condition on boost async operations
Enabled initial event tests
Add vsomeip config parsing
Whitelist initial events tests
Adds on_register_application_ack
Suspend resume tests fix
add service and method ids to the clients_ array
Fix capturing references to stack variables
Protects receiver_ and lock to routing stop function
Add include unordered map
Add remove local in deregistration(rmi)
protect deserialization from malicious input
Ignore send_cbk if the socket is not connected
Move suspend/resume of endpoints
Change handling of availabilities for wildcasts
Allow to configure the initial routing state
Enable subscription expiration
@duartenfonseca duartenfonseca merged commit c2de98d into master Nov 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants