Discussion:
Anaconda Thread timeout
Pat Riehecky
2016-01-26 16:17:13 UTC
Permalink
Is there a clean way to set a maximum runtime for an anaconda thread?

Pat
--
Pat Riehecky
Scientific Linux developer

Fermi National Accelerator Laboratory
www.fnal.gov
www.scientificlinux.org
Brian C. Lane
2016-01-26 16:34:41 UTC
Permalink
Post by Pat Riehecky
Is there a clean way to set a maximum runtime for an anaconda thread?
No, ThreadMgr is a pretty light framework. The code running in the
thread is responsible for shutting it down when done or raising errors
when there is a problem.

What are you trying to do that would need a timeout?
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
Pat Riehecky
2016-01-26 18:04:36 UTC
Permalink
Post by Brian C. Lane
Post by Pat Riehecky
Is there a clean way to set a maximum runtime for an anaconda thread?
No, ThreadMgr is a pretty light framework. The code running in the
thread is responsible for shutting it down when done or raising errors
when there is a problem.
What are you trying to do that would need a timeout?
I've got a thread watching the network state, if the network never comes
up (because the user didn't ask for it) it sticks.

I'll just add a check to how long it runs

Pat
David Lehman
2016-01-26 19:40:42 UTC
Permalink
Post by Pat Riehecky
Post by Brian C. Lane
Post by Pat Riehecky
Is there a clean way to set a maximum runtime for an anaconda thread?
No, ThreadMgr is a pretty light framework. The code running in the
thread is responsible for shutting it down when done or raising errors
when there is a problem.
What are you trying to do that would need a timeout?
I've got a thread watching the network state, if the network never
comesĀ 
up (because the user didn't ask for it) it sticks.
I'll just add a check to how long it runs
You could also use something like a threading.Event to signal the
thread that it can go ahead and shut down. Alternatively, if the
"sticking" is when anaconda's trying to exit, you could pass
daemon=False to the threading.Thread constructor which should make all
threads exit when the main thread does.

David
Post by Pat Riehecky
Pat
_______________________________________________
Anaconda-devel-list mailing list
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
Loading...