Skip to content

[BUG]: <title> Race conditon between tcp_server_enpoint_impl::accept_cbk, handle_eventgroup_subscription #971

@Simon-Park1

Description

@Simon-Park1

vSomeip Version

master

Boost Version

1.71

Environment

Embedded Linux (It might be happens in every OS)

Describe the bug

It seems there is race condition between tcp_server_enpoint_impl::accept_cbk, handle_eventgroup_subscription when using 2 or more io threads.

When TCP accepted, tcp_server_endpoint_impl::accept_cbk will be invoked in certain io thread.

and vsomip store connections in this code https://github.com/COVESA/vsomeip/blob/master/implementation/endpoints/src/tcp_server_endpoint_impl.cpp#L327-L332

And after connection accepted, client will send subscribe immediately for eventgroups.
In case of the eventgroup use reliable endpoint, SD will check connection has been established with this code https://github.com/COVESA/vsomeip/blob/master/implementation/service_discovery/src/service_discovery_impl.cpp#L2086

But this accept callback and handle_eventgroup_subscription can be executed on different thread when the routing application use 2 or more io threads.

so is_tcp_connected can return false event TCP connection has been established.

And will send SubscribeNack to client.

Reproduction Steps

No response

Expected behaviour

No response

Logs and Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions