]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
AsyncConnection: Fix time event is called after AsyncMessenger destruction 3101/head
authorHaomai Wang <haomaiwang@gmail.com>
Tue, 9 Dec 2014 08:55:28 +0000 (16:55 +0800)
committerHaomai Wang <haomaiwang@gmail.com>
Thu, 18 Dec 2014 15:36:27 +0000 (23:36 +0800)
commit1f9c08742161fed35b4f8af3d91e477c8e72c05e
tree8aa0c44c1bafcc140aeb28d48f2955b34de68cea
parent20ea08672226b42662a7a5967ae8c7e66bec09e9
AsyncConnection: Fix time event is called after AsyncMessenger destruction

AsyncConnection uses time event to handle async event partially, but it's not
very effective so here use dispatch_event_external instead.

And if client try to connect to server after a period, it may be call
AsyncConnection::process which will reference to AsyncMessenger. Since
AsyncMessenger doesn't use reference count, it will result in segment
fault. Now we record time event id and delete these registered time events
when stopping connection.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
src/msg/async/AsyncConnection.cc
src/msg/async/AsyncConnection.h
src/msg/async/AsyncMessenger.cc
src/msg/async/AsyncMessenger.h
src/msg/async/Event.cc
src/msg/async/Event.h