Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Nischal Sheth
committed
Apr 9, 2015
1 parent
26409ad
commit 757279d
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters