[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Thread safety of htcondor python bindings



Hi,

To elaborate - if you see a suspected threading issue in the python client, I would consider it a bug and should be reported.  There have been threading bugs in the past and I'm sure there will be some in the future.

The level of concurrency for writes (e.g., qedit, submit, act, etc) is very low -- only one process can proceed at a time.  If you have a lot of submits to perform, it makes sense to do it from one thread / process.  Doing it from two threads will simply cause each thread to take twice as long to finish (potentially causing timeouts).

For *reads* (queries, location lookups), a higher level of concurrency is likely OK.

Brian

On Feb 27, 2018, at 8:47 AM, John M Knoeller <johnkn@xxxxxxxxxxx> wrote:

The bindings themselves are thread safe as far as we know, but the HTCondor daemons are not multithreaded.   In particular, you *cannot*  have multiple python threads sending commands to the same HTCondor daemon simultaneously. 
 
You should design your python programs so that only one thread does job submission for any given schedd, or you are very likely to have intermittent failures of submission and disconnection by the schedd.
 
You can *probably* get away with multiple threads doing queries to the collector or schedd at the same time, but even then I would encourage you to try and avoid this.
 
-tj
 
From: HTCondor-users [mailto:htcondor-users-bounces@xxxxxxxxxxx] On Behalf Of Sandeep Gupta
Sent: Tuesday, February 27, 2018 7:50 AM
To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
Subject: Re: [HTCondor-users] Thread safety of htcondor python bindings
 
Hello Biruk,
 
I am a new user of the python bindings of ht condor. I primarily use it via multiprocessing module, and have seen no issues so far. Here is the source code for python bindings: https://github.com/htcondor/htcondor/tree/master/src/python-bindings

There are some synchronization mechanisms, but I am not aware of any thread safety guarantees. (I could be wrong though).
 
 
Sandeep.
 
On Mon, Feb 26, 2018 at 9:15 PM, Biruk Mammo <birukw@xxxxxxxxxx> wrote:
Hello,
 
Is the Python htcondor module guaranteed to be thread-safe?
 
 

_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/
 

This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. 
_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/