On Thu, Jul 24, 2014 at 08:44:30AM +0200, Marek Królikowski wrote:
> Like You see HOST 111 and 159 use this same ID? Mayby that`s a problem?
That IS the problem!

It seems uniqid() doesn't give unique IDs. It is essentially a hex
translation of time.  When you have small number of child pollers,
the chance of clash is small. However with many pollers, the chance
increases. 

It also explains why the file "goes away" and we see the stat() errors.
Host 1 & 2 have same temp file foo. Host 1 finishes first and deletes
file foo, but when Host 2 comes along, it stats for foo and its gone.

The solution is simple, don't use uniqid()!
I could of prepended the child ID into uniqid but to me if I have to
touch the code, then tempnam is a better choice.

Attached is a patch that uses tempnam() instead.
Thanks Marek, you help solve a long running bug.

Could anyone who saw this apply the patch and let me know how it goes?

 - Craig
-- 
Craig Small (@smallsees)   http://enc.com.au/       csmall at : enc.com.au
Debian GNU/Linux           http://www.debian.org/   csmall at : debian.org
GPG fingerprint:        5D2F B320 B825 D939 04D2  0519 3938 F96B DF50 FEA5
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
jffnms-users mailing list
jffnms-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jffnms-users

Reply via email to