Commit 3cb3cb18 authored by gejun's avatar gejun

Controller.DeleteStuff only cancels call_id unused by RPC

parent a2f294e9
...@@ -154,8 +154,7 @@ void Controller::DeleteStuff() { ...@@ -154,8 +154,7 @@ void Controller::DeleteStuff() {
_mongo_session_data.reset(); _mongo_session_data.reset();
delete _rpc_dump_meta; delete _rpc_dump_meta;
if (_correlation_id != INVALID_BTHREAD_ID && if (!is_used_by_rpc() && _correlation_id != INVALID_BTHREAD_ID) {
!has_flag(FLAGS_DESTROYED_CID)) {
CHECK_NE(EPERM, bthread_id_cancel(_correlation_id)); CHECK_NE(EPERM, bthread_id_cancel(_correlation_id));
} }
if (_oncancel_id != INVALID_BTHREAD_ID) { if (_oncancel_id != INVALID_BTHREAD_ID) {
...@@ -860,7 +859,6 @@ void Controller::EndRPC(const CompletionInfo& info) { ...@@ -860,7 +859,6 @@ void Controller::EndRPC(const CompletionInfo& info) {
// Check comments in above branch on bthread_about_to_quit. // Check comments in above branch on bthread_about_to_quit.
bthread_about_to_quit(); bthread_about_to_quit();
add_flag(FLAGS_DESTROYED_CID);
CHECK_EQ(0, bthread_id_unlock_and_destroy(saved_cid)); CHECK_EQ(0, bthread_id_unlock_and_destroy(saved_cid));
} }
} }
......
...@@ -107,7 +107,6 @@ friend void policy::ProcessMongoRequest(InputMessageBase*); ...@@ -107,7 +107,6 @@ friend void policy::ProcessMongoRequest(InputMessageBase*);
static const uint32_t FLAGS_READ_PROGRESSIVELY = (1 << 3); static const uint32_t FLAGS_READ_PROGRESSIVELY = (1 << 3);
static const uint32_t FLAGS_PROGRESSIVE_READER = (1 << 4); static const uint32_t FLAGS_PROGRESSIVE_READER = (1 << 4);
static const uint32_t FLAGS_BACKUP_REQUEST = (1 << 5); static const uint32_t FLAGS_BACKUP_REQUEST = (1 << 5);
static const uint32_t FLAGS_DESTROYED_CID = (1 << 6);
// Let _done delete the correlation_id, used by combo channels to // Let _done delete the correlation_id, used by combo channels to
// make lifetime of the correlation_id more flexible. // make lifetime of the correlation_id more flexible.
static const uint32_t FLAGS_DESTROY_CID_IN_DONE = (1 << 7); static const uint32_t FLAGS_DESTROY_CID_IN_DONE = (1 << 7);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment