@@ -24,6 +24,7 @@ UnaryFinishFutureImpl::UnaryFinishFutureImpl(UnaryFinishFutureImpl&& other) noex
2424
2525UnaryFinishFutureImpl& UnaryFinishFutureImpl::operator =(UnaryFinishFutureImpl&& other) noexcept {
2626 if (this == &other) return *this ;
27+ // we should destruct current instance
2728 [[maybe_unused]] auto for_destruction = std::move (*this );
2829 // state_ == nullptr signals that *this is empty. Other fields may remain garbage in `other`.
2930 state_ = std::exchange (other.state_ , nullptr );
@@ -61,8 +62,8 @@ engine::FutureStatus UnaryFinishFutureImpl::WaitUntil(engine::Deadline deadline)
6162 switch (wait_status) {
6263 case impl::AsyncMethodInvocation::WaitStatus::kOk :
6364 state_->SetFinishProcessed ();
65+ state_->GetStatsScope ().SetFinishTime (finish.GetFinishTime ());
6466 try {
65- state_->GetStatsScope ().SetFinishTime (finish.GetFinishTime ());
6667 ProcessFinish (*state_, response_);
6768 } catch (...) {
6869 exception_ = std::current_exception ();
@@ -71,13 +72,9 @@ engine::FutureStatus UnaryFinishFutureImpl::WaitUntil(engine::Deadline deadline)
7172
7273 case impl::AsyncMethodInvocation::WaitStatus::kError :
7374 state_->SetFinishProcessed ();
74- try {
75- state_->GetStatsScope ().SetFinishTime (finish.GetFinishTime ());
76- ProcessFinishNetworkError (*state_);
77- exception_ = std::make_exception_ptr (RpcInterruptedError (state_->GetCallName (), " Finish" ));
78- } catch (...) {
79- exception_ = std::current_exception ();
80- }
75+ state_->GetStatsScope ().SetFinishTime (finish.GetFinishTime ());
76+ ProcessFinishNetworkError (*state_);
77+ exception_ = std::make_exception_ptr (RpcInterruptedError (state_->GetCallName (), " Finish" ));
8178 return engine::FutureStatus::kReady ;
8279
8380 case impl::AsyncMethodInvocation::WaitStatus::kCancelled :
0 commit comments