Thread terminating 10 seconds after entering __del__
Abdallah Khazaal <Abdallah.Khazaal-F0cRZVf0dWGrG/[email protected]>
| Newsgroups | gmane.comp.java.grinder.user |
|---|---|
| Message-ID | <CF0DE3EF8EC31843A37D85A4E5B6057901BA04B5B434@CPGEXMBCCR01.cpggpc.ad> |
Hi All,
My script tries to execute "final code" in __del__ after all threads complete their work in __call__ (i.e. after the grinder.duration is reached).
def __del__(self):
# Wait for all other threads to complete before executing further
self.finalCompleteBarrier.await()
if grinder.getThreadNumber() == 0:
# If this is Thread 0, retrieve files from remote server
copyFiles()
This is working as expected except that the process is terminated before the copyFiles() procedure is completed.
My understanding is that the main thread doesn't terminate the worker threads and exists the process until 10 seconds pass after the worker threads signal that should exit.
In most cases, this should be enough time to finish executing the code in __del__ for each thread. However, in my case, if the copyFiles() procedure takes longer than 10 seconds (say because they are copied form remote server or the files are too big), then the process terminates before completing the job.
Is there a way to increase the 10 seconds waiting time to allow for more executing time in __del__?
If not, are you aware of a better way/place to execute final code once?
Thanks in advance for your help!
Abdallah
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
grinder-use mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-use