{"action":"created","issue":{"url":"https://api.github.com/repos/radical-cybertools/saga-python/issues/420","labels_url":"https://api.github.com/repos/radical-cybertools/saga-python/issues/420/labels{/name}","comments_url":"https://api.github.com/repos/radical-cybertools/saga-python/issues/420/comments","events_url":"https://api.github.com/repos/radical-cybertools/saga-python/issues/420/events","html_url":"https://github.com/radical-cybertools/saga-python/issues/420","id":70154776,"number":420,"title":"Excessive polling of PBS server","user":{"login":"capaulson","id":210252,"avatar_url":"https://avatars.githubusercontent.com/u/210252?v=3","gravatar_id":"","url":"https://api.github.com/users/capaulson","html_url":"https://github.com/capaulson","followers_url":"https://api.github.com/users/capaulson/followers","following_url":"https://api.github.com/users/capaulson/following{/other_user}","gists_url":"https://api.github.com/users/capaulson/gists{/gist_id}","starred_url":"https://api.github.com/users/capaulson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capaulson/subscriptions","organizations_url":"https://api.github.com/users/capaulson/orgs","repos_url":"https://api.github.com/users/capaulson/repos","events_url":"https://api.github.com/users/capaulson/events{/privacy}","received_events_url":"https://api.github.com/users/capaulson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-22T15:11:54Z","updated_at":"2015-04-22T15:48:57Z","closed_at":null,"body":"I have a script that I use to take jobs from a database and run them on a cluster. This morning, I received notification that this script had caused significant issues with the PBS server. At the time, I was using saga-python to monitor 50 jobs, each in an individual thread. The code executed in each thread is: \r\n\r\n```python\r\njs = saga.job.Service(\"someserver\")\r\njd = saga.job.Description()\r\n#other job configuration tasks go here... \r\ncatjob = js.create_job(jd)\r\ncatjob.run()\r\nprint \"Job ID : %s\" % (catjob.id)\r\nprint \"Job State : %s\" % (catjob.state)\r\ncatjob.wait()\r\nprint \"Job ID: %s\" % (catjob.id)\r\nprint \"Job State : %s\" % (catjob.state)\r\nprint \"Exitcode : %s\" % (catjob.exit_code)\r\njs.close()\r\n```\r\n\r\nAfter approximately 24 hours of the script running, the PBS server started not responding to other users. The cluster admins informed me that I had tied up over 25,000 TCP ports, effectively DOSing other users. I would like to understand if this is expected behavior for saga-python, and if so, how do I tune the level of polling?"},"comment":{"url":"https://api.github.com/repos/radical-cybertools/saga-python/issues/comments/95243586","html_url":"https://github.com/radical-cybertools/saga-python/issues/420#issuecomment-95243586","issue_url":"https://api.github.com/repos/radical-cybertools/saga-python/issues/420","id":95243586,"user":{"login":"andre-merzky","id":1319674,"avatar_url":"https://avatars.githubusercontent.com/u/1319674?v=3","gravatar_id":"","url":"https://api.github.com/users/andre-merzky","html_url":"https://github.com/andre-merzky","followers_url":"https://api.github.com/users/andre-merzky/followers","following_url":"https://api.github.com/users/andre-merzky/following{/other_user}","gists_url":"https://api.github.com/users/andre-merzky/gists{/gist_id}","starred_url":"https://api.github.com/users/andre-merzky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andre-merzky/subscriptions","organizations_url":"https://api.github.com/users/andre-merzky/orgs","repos_url":"https://api.github.com/users/andre-merzky/repos","events_url":"https://api.github.com/users/andre-merzky/events{/privacy}","received_events_url":"https://api.github.com/users/andre-merzky/received_events","type":"User","site_admin":false},"created_at":"2015-04-22T15:48:57Z","updated_at":"2015-04-22T15:48:57Z","body":"Woah, that is certainly *not* the expected behavior!  I'll look into that, thanks for the report.  `js.close()` should tear those monitoring threads down.\r\n\r\nHaving said that, creating a service instance is a very costly operation, both in terms of time it needs to set up the connection, and in terms of resources used on both ends.  Is there any specific reason that prevents you from re-using the `job.Service` instance for the individual jobs?"}}