Resolved an issue where the Lua background would always exceed the execution time limit.
Signed-off-by: Oshrey Avraham <oshrey16@gmail.com>
ldpp_dout(dpp, 10) << "Lua background thread resumed" << dendl;
}
+ lguard.reset_start_time();
const auto rc = read_script();
if (rc == -ENOENT || rc == -EAGAIN) {
// either no script or paused, nothing to do
class lua_state_guard {
const std::size_t max_memory;
const std::chrono::milliseconds max_runtime;
- const ceph::real_clock::time_point start_time;
+ ceph::real_clock::time_point start_time;
const DoutPrefixProvider* const dpp;
lua_State* const state;
const DoutPrefixProvider* _dpp);
~lua_state_guard();
lua_State* get() { return state; }
+ void reset_start_time() { start_time = ceph::real_clock::now(); }
};
int dostring(lua_State* L, const char* str);