Project

General

Profile

Actions

Bug #1158

closed

mod_magnet/mod_status: duplicate keys in lighty.status[]

Added by moe almost 17 years ago. Updated almost 8 years ago.

Status:
Missing Feedback
Priority:
Normal
Category:
mod_magnet
Target version:
-
ASK QUESTIONS IN Forums:

Description

we're using lighttpd 1.4.15 with mod_magnet, lua 5.1.2 and the following
lua script to get a simple hit-counter for monitoring purposes:


-- simple hit counter
local prefix = "(none)" 
if ( string.find( reqpath, "/", 2 ) ) then
    prefix = string.match( reqpath, "^([^/]*)", 2 )
end

lighty.status["counter.prefix." .. prefix ] = lighty.status["counter.prefix." .. prefix ] + 1
lighty.status["counter.total" ] = lighty.status["counter.total" ] + 1

the script is referenced like this in our lighty.conf:


magnet.attract-raw-url-to = ( "/path/to/lighty.lua" )

this has worked fine for a while but when i call mod_status right now
i get duplicate keys for several popular prefixes, example:


$ curl -s http://127.0.0.1:7979/status | grep base
counter.prefix.base: 8875226
counter.prefix.base: 2206508

only the 2nd value is still incrementing. it seems like the first key
was abandoned at some point in time and a new one with the same name created.
there have been no restarts or script changes in the meantime and i see no
related errors in error.log.

i'd suspect some kind of race condition (the server is dealing ~20 hits/sec) -
but interestingly the "total" counter hasn't been duplicated, yet (39510989 still tickin..).

can anyone shed some light on this?

Actions #1

Updated by gstrauss almost 8 years ago

  • Description updated (diff)
  • Status changed from New to Missing Feedback
  • Assignee deleted (jan)
  • Target version deleted (1.5.0)

I can't immediately see why that would happen in the current version of lighttpd 1.4.x
If this is still an issue with lighttpd 1.4.40, please reopen ticket. Thanks.

Actions

Also available in: Atom