redict/tests/unit/moduleapi
Oran Agra 233abbbe03
Cleanup around script_caller, fix tracking of scripts and ACL logging for RM_Call (#11770)
* Make it clear that current_client is the root client that was called by
  external connection
* add executing_client which is the client that runs the current command
  (can be a module or a script)
* Remove script_caller that was used for commands that have CLIENT_SCRIPT
  to get the client that called the script. in most cases, that's the current_client,
  and in others (when being called from a module), it could be an intermediate
  client when we actually want the original one used by the external connection.

bugfixes:
* RM_Call with C flag should log ACL errors with the requested user rather than
  the one used by the original client, this also solves a crash when RM_Call is used
  with C flag from a detached thread safe context.
* addACLLogEntry would have logged info about the script_caller, but in case the
  script was issued by a module command we actually want the current_client. the
  exception is when RM_Call is called from a timer event, in which case we don't
  have a current_client.

behavior changes:
* client side tracking for scripts now tracks the keys that are read by the script
  instead of the keys that are declared by the caller for EVAL

other changes:
* Log both current_client and executing_client in the crash log.
* remove prepareLuaClient and resetLuaClient, being dead code that was forgotten.
* remove scriptTimeSnapshot and snapshot_time and instead add cmd_time_snapshot
  that serves all commands and is reset only when execution nesting starts.
* remove code to propagate CLIENT_FORCE_REPL from the executed command
  to the script caller since scripts aren't propagated anyway these days and anyway
  this flag wouldn't have had an effect since CLIENT_PREVENT_PROP is added by scriptResetRun.
* fix a module GIL violation issue in afterSleep that was introduced in #10300 (unreleased)
2023-02-16 08:07:35 +02:00
..
aclcheck.tcl Unify ACL failure error messaging. (#11160) 2022-10-16 09:01:37 +03:00
auth.tcl Fix module redact test for valgrind (#10432) 2022-03-16 08:53:57 +02:00
basics.tcl Fix crash on RM_Call inside module load (#11346) 2022-10-12 13:09:51 +03:00
blockedclient.tcl Fix crash on RM_Call with script mode. (#10886) 2022-06-21 10:01:13 +03:00
blockonbackground.tcl Changed latency histogram output to omit trailing 0s and periods (#10075) 2022-01-09 17:04:18 -08:00
blockonkeys.tcl Minor changes around the blockonkeys test module (#11803) 2023-02-14 20:06:30 +02:00
cluster.tcl Cleanup: Get rid of server.core_propagates (#11572) 2022-12-20 09:51:50 +02:00
cmdintrospection.tcl Fix memory leak in moduleFreeCommand (#11147) 2022-08-18 12:36:01 +03:00
commandfilter.tcl Fix potential issue with Lua argv caching, module command filter and libc realloc (#11652) 2023-01-04 11:03:55 +02:00
datatype2.tcl Tests: don't rely on the response of MEMORY USAGE when mem_allocator is not jemalloc (#10010) 2021-12-27 21:37:21 +02:00
datatype.tcl Adding module api for processing commands during busy jobs and allow flagging the commands that should be handled at this status (#9963) 2022-01-20 09:05:53 +02:00
defrag.tcl Tests: fix new defrag test to be skipped when not supported (#8185) 2020-12-14 11:13:46 +02:00
eventloop.tcl sub-command support for ACL CAT and COMMAND LIST. redisCommand always stores fullname (#10127) 2022-01-23 10:05:06 +02:00
fork.tcl Fix race in module fork kill test (#10717) 2022-05-12 20:10:38 +03:00
getchannels.tcl Implemented module getchannels api and renamed channel keyspec (#10299) 2022-02-22 11:00:03 +02:00
getkeys.tcl Unify ACL failure error messaging. (#11160) 2022-10-16 09:01:37 +03:00
hash.tcl sub-command support for ACL CAT and COMMAND LIST. redisCommand always stores fullname (#10127) 2022-01-23 10:05:06 +02:00
hooks.tcl Add a special notification unlink available only for modules (#9406) 2022-11-30 11:56:36 +02:00
infotest.tcl Fix missing sections for INFO ALL with module (#11291) 2022-09-21 08:10:03 +03:00
infra.tcl Build TLS as a loadable module 2022-08-23 12:37:56 +03:00
keyspace_events.tcl Module API to allow writes after key space notification hooks (#11199) 2022-11-24 19:00:04 +02:00
keyspecs.tcl Unify ACL failure error messaging. (#11160) 2022-10-16 09:01:37 +03:00
list.tcl Add listpack encoding for list (#11303) 2022-11-16 20:29:46 +02:00
mallocsize.tcl Add RM_MallocSizeString, RM_MallocSizeDict (#10542) 2022-04-17 08:31:57 +03:00
misc.tcl Cleanup around script_caller, fix tracking of scripts and ACL logging for RM_Call (#11770) 2023-02-16 08:07:35 +02:00
moduleconfigs.tcl Build TLS as a loadable module 2022-08-23 12:37:56 +03:00
postnotifications.tcl Module API to allow writes after key space notification hooks (#11199) 2022-11-24 19:00:04 +02:00
propagate.tcl reprocess command when client is unblocked on keys (#11012) 2023-01-01 23:35:42 +02:00
publish.tcl Sharded pubsub publish messagebulk as smessage (#10792) 2022-05-31 08:03:59 +03:00
reply.tcl Normalize NAN to a single nan type, like we do with inf (#11597) 2022-12-08 19:29:30 +02:00
scan.tcl Fix zuiFind crash / RM_ScanKey hang on SET object listpack encoding (#11581) 2022-12-09 17:08:01 +02:00
stream.tcl sub-command support for ACL CAT and COMMAND LIST. redisCommand always stores fullname (#10127) 2022-01-23 10:05:06 +02:00
subcommands.tcl Fix regression not aborting transaction on error, and re-edit some error responses (#10612) 2022-04-25 13:08:13 +03:00
test_lazyfree.tcl Sort out mess around propagation and MULTI/EXEC (#9890) 2021-12-23 00:03:48 +02:00
testrdb.tcl Avoid saving module aux on RDB if no aux data was saved by the module. (#11374) 2022-10-18 19:45:46 +03:00
timer.tcl forbid module to unload when it holds ongoing timer (#10187) 2022-02-01 14:54:11 +02:00
usercall.tcl Cleanup around script_caller, fix tracking of scripts and ACL logging for RM_Call (#11770) 2023-02-16 08:07:35 +02:00
zset.tcl sub-command support for ACL CAT and COMMAND LIST. redisCommand always stores fullname (#10127) 2022-01-23 10:05:06 +02:00