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

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



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