Skip to content

Commit

Permalink
Extra logs are added to the lua scripts at the debug level
Browse files Browse the repository at this point in the history
When lua script returns an error, we print the error string while asserting

Change-Id: I5ce6acfc1c7abcf98151b8558d1770f3859d21cf
Closes-Bug: 1531712
  • Loading branch information
anishmehta committed Mar 15, 2016
1 parent e94c987 commit bb5ea4e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/analytics/OpServerProxy.cc
Expand Up @@ -8,6 +8,7 @@
#include <tbb/mutex.h>
#include <boost/bind.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/assert.hpp>
#include "base/util.h"
#include "base/logging.h"
#include "base/parse_object.h"
Expand Down Expand Up @@ -362,7 +363,7 @@ class OpServerProxy::OpServerImpl {
// If redis returns error for async request, then perhaps it
// is busy executing a script and it has reached the maximum
// execution time limit.
assert(reply->type != REDIS_REPLY_ERROR);
BOOST_ASSERT_MSG(reply->type != REDIS_REPLY_ERROR, reply->str);

if (rpi) {
rpi->ProcessCallback(reply);
Expand Down
1 change: 1 addition & 0 deletions src/analytics/flushuves.lua
Expand Up @@ -6,3 +6,4 @@ redis.log(redis.LOG_NOTICE,"WARNING: Flushing Redis UVE DB")
local db = tonumber(ARGV[1])
redis.call('select',db)
redis.call('flushdb')
redis.log(redis.LOG_DEBUG,"WARNING: Flushing Redis UVE DB done")
1 change: 1 addition & 0 deletions src/analytics/seqnum.lua
Expand Up @@ -17,4 +17,5 @@ for k,v in pairs(typ) do
end
end
redis.call('sadd', "NGENERATORS", ARGV[1]..":"..ARGV[2]..":"..ARGV[3]..":"..ARGV[4])
redis.log(redis.LOG_DEBUG,"GetSeq for "..ARGV[1]..":"..ARGV[2]..":"..ARGV[3]..":"..ARGV[4].." done")
return res
4 changes: 4 additions & 0 deletions src/analytics/uveupdate.lua
Expand Up @@ -18,6 +18,8 @@ local _table = KEYS[3]
local _uves = KEYS[4]
local _values = KEYS[5]

redis.log(redis.LOG_DEBUG,"UVEUpdate for "..sm.." key "..key.." type:attr "..typ..":"..attr)

redis.call('select',db)
local ism = redis.call('sismember', 'NGENERATORS', sm)
if ism == 0 then
Expand All @@ -35,4 +37,6 @@ redis.call('sadd',_table,key..':'..sm..":"..typ)
redis.call('zadd',_uves,seq,key)
redis.call('hset',_values,attr,val)

redis.log(redis.LOG_DEBUG,"UVEUpdate for "..sm.." key "..key.." done")

return true

0 comments on commit bb5ea4e

Please sign in to comment.