Comment 9 for bug 1441339

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/9025
Committed: http://github.org/Juniper/contrail-controller/commit/b7f6c4f5fdf52de74d6cba749b8f99726826e38b
Submitter: Zuul
Branch: R1.10

commit b7f6c4f5fdf52de74d6cba749b8f99726826e38b
Author: Nischal Sheth <email address hidden>
Date: Thu Apr 9 10:34:07 2015 -0700

Fix concurrency issue in TcpSession::AsyncReadStart

Arrange for async_read_some on the underlying socket to be called
from the io thread instead of calling it directly from io::Reader
Task.

This commit addresses the read side concurrency issue with socket.
The write side issue will be addressed via another commit. Note
that we haven't seen any problems that can be attributed to write
side concurrency yet.

Make AsyncReadStart a noop for BgpSessionMock as the strand post
operation interferes with EvmManager::RunOnce.

Changes in state_machine_test.cc are needed to fix an existing bug
that got exposed as a result of making AsyncReadStart virtual. The
issue was that StateMachine::PassiveOpen enqueues EvTcpPassiveOpen
and then calls AsyncReadStart on the BgpSession. There's a chance
that the BgpSession gets deleted when processing EvTcpPassiveOpen
i.e. before the call to AsyncReadStart. This is not a problem in
production code because StateMachine::PassiveOpen is called from
bgp::Config Task which is exclusive with bgp::StateMachine Task.
However in the test, StateMachine::PassiveOpen is called from the
main thread.

Change-Id: If78b36c6fc7d45afd320b7e1ca245757c573deec
Partial-Bug: 1441339