Replies: 1 comment
-
How do you think @KvrocksLabs/committers |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have implemented the
eval
,evalsha
, and script command,but script subcommand
kill
was still investigated since it doesn't have an easy way to implement for kvrocks.The first main obstacle was that kvrocks design internal has no way to process other clients' queries in the Lua hook function, so it can't process the
script kill
command since the Lua script was still running. The second was the kvrocks was a multi-threads model, and use a global lock to prevent the data race when running the Lua script, so we MUST yield the global lock to make other clients have a chance to execute the new query which was a bit tricky.Changing the kvrocks client's design wasn't impracticable and unnecessary for implementing the
script kill
, but We think it's important to stop the long-running Lua script without restartting the server. A possible workaround was to kill the Lua script when reaches the time limit(likelua-time-limit
in Redis but SHOULD be another name).Beta Was this translation helpful? Give feedback.
All reactions