fix(server): Correctly set expiration from Lua scripts (#2080)

We used to set `time_now_ms_` only in the non-squashed execution path.

Fixes #2034
This commit is contained in:
Shahar Mike 2023-10-27 13:13:47 +03:00 committed by GitHub
parent 474ea5137a
commit 502efd80b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View file

@ -1685,16 +1685,17 @@ void Service::EvalInternal(CmdArgList args, const EvalArgs& eval_args, Interpret
});
++ServerState::tlocal()->stats.eval_shardlocal_coordination_cnt;
boost::intrusive_ptr<Transaction> stub_tx = new Transaction{tx, *sid};
cntx->transaction = stub_tx.get();
tx->PrepareMultiForScheduleSingleHop(*sid, tx->GetDbIndex(), args);
tx->ScheduleSingleHop([&](Transaction*, EngineShard*) {
boost::intrusive_ptr<Transaction> stub_tx = new Transaction{tx, *sid};
cntx->transaction = stub_tx.get();
result = interpreter->RunFunction(eval_args.sha, &error);
cntx->transaction = tx;
return OpStatus::OK;
});
cntx->transaction = tx;
if (*sid != ServerState::tlocal()->thread_index()) {
VLOG(1) << "Migrating connection " << cntx->conn() << " from " << ProactorBase::GetIndex()
<< " to " << *sid;