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

Re: [HTCondor-users] python-bindings and flask



Hello,

I got condor 8.3.4, andÂxquery works fine!

Though it appears there's some issue with the default value of the "requirements" param:
ValueError: Unable to parse requirements _expression_

I need to explicit use myschedd.xquery(requirements='true').

Thanks Brian,

Ricardo Oda

On Fri, Apr 10, 2015 at 12:16 PM, Brian Bockelman <bbockelm@xxxxxxxxxxx> wrote:
Hi Ricardo,

It looks like flask and HTCondor are competing over the GIL and end up in a deadlock.

I havenât quite figured out who is at fault (and even if I did, the next release wonât happen immediately); however, it seems that the newer âxqueryâ method doesnât suffer this issue. Do you have a new enough version of HTCondor to use that?

Sorry for the issue,

Brian

On Apr 10, 2015, at 12:03 AM, Ricardo Oda <odaric@xxxxxxxxxx> wrote:

Hi Brian,

Can you possible capture a stack trace when this occurs?

There's no stack trace, the process just stop responding and I need to kill it.

Â
What platform do you use?

I use an Ubuntu14.04.2 on a virtualbox machine for developing, and some Ubuntu Servers 12.04.5 at a private cloud as a deployment enviroment. Both with condor 8.3.4.

Â
Iâm not familiar with flask - exactly how hard is it to replicate the problem? Is it really as simple as doing the script below with an âimport flaskâ beforehand (if so, I canât replicate it immediatelyâ)?

With that simple script I can reproduce on my developing enviroment but not in the deployment one.
I'm not sure of the root cause of the problem, but the following one reproduces on my developing enviroment:

import htcondor
from flask import Flask
app = Flask(__name__)

@app.route("/")
def jobs():
  s = htcondor.Schedd()
  msg = str(s.query())
  return msg

if __name__ == "__main__":
  app.debug = True
  app.run()

The above script should setup a server on http://localhost:5000 that prints your job ads. To enable external access, change app.run() to app.run(host='0.0.0.0').
For the problem to occur, the schedd query() must be inside the routed function, in this case jobs(), and app.debug must be set True.

This is a weird problem but not a major for my monitoring, I can try different approaches if it cannot be reproduced.

Thanks,
Ricardo Oda
_______________________________________________
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/


_______________________________________________
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/