1. 19 Nov, 2019 1 commit
  2. 06 Nov, 2019 3 commits
    • antirez's avatar
      Update PR #6537: use a fresh time outside call(). · d3f4dec4
      antirez authored
      One problem with the solution proposed so far in #6537 is that key
      lookups outside a command execution via call(), still used a cached
      time. The cached time needed to be refreshed in multiple places,
      especially because of modules callbacks from timers, cluster bus, and
      thread safe contexts, that may use RM_Open().
      
      In order to avoid this problem, this commit introduces the ability to
      detect if we are inside call(): this way we can use the reference fixed
      time only when we are in the context of a command execution or Lua
      script, but for the asynchronous lookups, we can still use mstime() to
      get a fresh time reference.
      d3f4dec4
    • antirez's avatar
      Update PR #6537 patch to for generality. · 33f42665
      antirez authored
      After the thread in #6537 and thanks to the suggestions received, this
      commit updates the original patch in order to:
      
      1. Solve the problem of updating the time in multiple places by updating
      it in call().
      2. Avoid introducing a new field but use our cached time.
      
      This required some minor refactoring to the function updating the time,
      and the introduction of a new cached time in microseconds in order to
      use less gettimeofday() calls.
      33f42665
    • zhaozhao.zz's avatar
      expires: refactoring judgment about whether a key is expired · 68d71d83
      zhaozhao.zz authored
      Calling lookupKey*() many times to search a key in one command
      may get different result.
      
      That's because lookupKey*() calls expireIfNeeded(), and delete
      the key when reach the expire time. So we can get an robj before
      the expire time, but a NULL after the expire time.
      
      The worst is that may lead to Redis crash, for example
      `RPOPLPUSH foo foo` the first time we get a list form `foo` and
      hold the pointer, but when we get `foo` again it's expired and
      deleted. Now we hold a freed memory, when execute rpoplpushHandlePush()
      redis crash.
      
      To fix it, we can refactor the judgment about whether a key is expired,
      using the same basetime `server.cmd_start_mstime` instead of calling
      mstime() everytime.
      68d71d83
  3. 13 May, 2019 4 commits
  4. 13 Mar, 2019 1 commit
  5. 01 Mar, 2019 1 commit
  6. 12 Dec, 2018 1 commit
  7. 11 Dec, 2018 4 commits
  8. 07 Nov, 2018 1 commit
    • valentino's avatar
      fix short period of server.hz being uninitialized · 88805cbb
      valentino authored
      server.hz was uninitialized between initServerConfig and initServer.
      this can lead to someone (e.g. queued modules) doing createObject,
      and accessing an uninitialized variable, that can potentially be 0,
      and lead to a crash.
      88805cbb
  9. 05 Nov, 2018 2 commits
  10. 17 Oct, 2018 3 commits
  11. 15 Oct, 2018 1 commit
  12. 03 Oct, 2018 6 commits
  13. 14 Sep, 2018 4 commits
  14. 05 Sep, 2018 2 commits
  15. 04 Sep, 2018 2 commits
    • antirez's avatar
      While the slave is busy, just accumulate master input. · c2b104c7
      antirez authored
      Processing command from the master while the slave is in busy state is
      not correct, however we cannot, also, just reply -BUSY to the
      replication stream commands from the master. The correct solution is to
      stop processing data from the master, but just accumulate the stream
      into the buffers and resume the processing later.
      
      Related to #5297.
      c2b104c7
    • antirez's avatar
      Allow scripts to timeout on slaves as well. · adc4e031
      antirez authored
      See reasoning in #5297.
      adc4e031
  16. 29 Aug, 2018 4 commits