Re: clamd: Keep scanning while reloading database

Mark Pizzolato - ClamAV-devel <[email protected]>
Newsgroups gmane.comp.security.virus.clamav.devel
Message-ID <0CC6789C1C831B4C8CCFF49D45D7010F0127ED999C43@REDROOF2.alohasunset.com>
> > 1) Start reload_db() in a background thread, resume scanning, and call
> >    back once the new engine is in place; then exchange the pointers
> >    from old to new engine and free the old one.
> 
> FWIW, I have implemented this option, and it seems to work just fine.
> Patch is pasted below.
> 
> Do you see any problems with this approach?

Hi,

I haven't looked closely, but how is the fact that each thread (which may currently be scanning a different file and may finish at some arbitrary time in the future) has a reference to the current engine object handled?  It would seem that some sort of a reference count could be used to manage which thread actually frees the engine object which is being replaced...  Maybe the settings object also needs a local reference in each of the scanning threads...

- Mark Pizzolato


_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.