{"action":"created","issue":{"url":"https://api.github.com/repos/Unidata/LDM/issues/34","labels_url":"https://api.github.com/repos/Unidata/LDM/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/Unidata/LDM/issues/34/comments","events_url":"https://api.github.com/repos/Unidata/LDM/issues/34/events","html_url":"https://github.com/Unidata/LDM/issues/34","id":62486134,"number":34,"title":"RFE: Add -wait option to pqact PIPE actions","user":{"login":"akrherz","id":210858,"avatar_url":"https://avatars.githubusercontent.com/u/210858?v=3","gravatar_id":"","url":"https://api.github.com/users/akrherz","html_url":"https://github.com/akrherz","followers_url":"https://api.github.com/users/akrherz/followers","following_url":"https://api.github.com/users/akrherz/following{/other_user}","gists_url":"https://api.github.com/users/akrherz/gists{/gist_id}","starred_url":"https://api.github.com/users/akrherz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akrherz/subscriptions","organizations_url":"https://api.github.com/users/akrherz/orgs","repos_url":"https://api.github.com/users/akrherz/repos","events_url":"https://api.github.com/users/akrherz/events{/privacy}","received_events_url":"https://api.github.com/users/akrherz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-03-17T19:01:16Z","updated_at":"2015-03-19T16:39:23Z","closed_at":null,"body":"Hi Unidata/Steve,\r\n\r\nI would really like to see a \"-wait\" or equivalent option added to PIPE/EXEC actions to effectively limit the number of processes one pqact could have active at one time.  This flag would cause pqact to not recycle the slot until that process has exited.  I think I discussed this with you many years ago and you were not enthusiastic about it as misbehaving/naughty processes could wedge up and effectively jam up pqact as well as pqact waits for these processes to exit...\r\n\r\nThe issue is that any process that has this one product in execution model, could effectively DOS a system as pqact exec's off one process per product received.  Starting up LDM after a considerable downtime is one example.  Another is some products that come in rapid succession...\r\n\r\nCurrently, users have two options:\r\n\r\n1. Allow their process to handle more than one product on stdin, effectively making it long running\r\n2. Add some locking mechanism that checks to see if others like it are currently running and then sleeps for a bit waiting for those to exit.\r\n\r\nI personally loathe option 2 as having potentially hundreds of scripts writing lock files and sleeping is a race condition waiting to happen.  I have written lots of processes that do option 1, but not all are well suited for it.  For example, satellite data processors.\r\n\r\nA nice aspect of this is that pqact could then log non-zero exit statuses from these '-wait' processes, which would help users debugging this.  Perhaps some other logging would already kick in, if pqact had no available slots over some given about of time, I am unsure of that one.\r\n\r\nI think a reasonable exception is for '-wait' to imply a '-close' as well.  I'd be happy to provide feedback if there are other edge cases you anticipate.  Thanks for your consideration :)"},"comment":{"url":"https://api.github.com/repos/Unidata/LDM/issues/comments/83654062","html_url":"https://github.com/Unidata/LDM/issues/34#issuecomment-83654062","issue_url":"https://api.github.com/repos/Unidata/LDM/issues/34","id":83654062,"user":{"login":"semmerson","id":613629,"avatar_url":"https://avatars.githubusercontent.com/u/613629?v=3","gravatar_id":"","url":"https://api.github.com/users/semmerson","html_url":"https://github.com/semmerson","followers_url":"https://api.github.com/users/semmerson/followers","following_url":"https://api.github.com/users/semmerson/following{/other_user}","gists_url":"https://api.github.com/users/semmerson/gists{/gist_id}","starred_url":"https://api.github.com/users/semmerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/semmerson/subscriptions","organizations_url":"https://api.github.com/users/semmerson/orgs","repos_url":"https://api.github.com/users/semmerson/repos","events_url":"https://api.github.com/users/semmerson/events{/privacy}","received_events_url":"https://api.github.com/users/semmerson/received_events","type":"User","site_admin":false},"created_at":"2015-03-19T16:39:23Z","updated_at":"2015-03-19T16:39:23Z","body":"If the problem is that a service external to the LDM can only handle a limited number of requests, then a possible solution would be to have the relevant decoder use a semaphore that was initialized to this number. Can this be done in Python?"}}