{"action":"created","issue":{"url":"https://api.github.com/repos/bird-house/flyingpigeon/issues/240","repository_url":"https://api.github.com/repos/bird-house/flyingpigeon","labels_url":"https://api.github.com/repos/bird-house/flyingpigeon/issues/240/labels{/name}","comments_url":"https://api.github.com/repos/bird-house/flyingpigeon/issues/240/comments","events_url":"https://api.github.com/repos/bird-house/flyingpigeon/issues/240/events","html_url":"https://github.com/bird-house/flyingpigeon/issues/240","id":319830277,"number":240,"title":"Wrong app initialization in wsgi.py","user":{"login":"cehbrecht","id":4965260,"avatar_url":"https://avatars1.githubusercontent.com/u/4965260?v=4","gravatar_id":"","url":"https://api.github.com/users/cehbrecht","html_url":"https://github.com/cehbrecht","followers_url":"https://api.github.com/users/cehbrecht/followers","following_url":"https://api.github.com/users/cehbrecht/following{/other_user}","gists_url":"https://api.github.com/users/cehbrecht/gists{/gist_id}","starred_url":"https://api.github.com/users/cehbrecht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cehbrecht/subscriptions","organizations_url":"https://api.github.com/users/cehbrecht/orgs","repos_url":"https://api.github.com/users/cehbrecht/repos","events_url":"https://api.github.com/users/cehbrecht/events{/privacy}","received_events_url":"https://api.github.com/users/cehbrecht/received_events","type":"User","site_admin":false},"labels":[{"id":126504563,"url":"https://api.github.com/repos/bird-house/flyingpigeon/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":{"login":"cehbrecht","id":4965260,"avatar_url":"https://avatars1.githubusercontent.com/u/4965260?v=4","gravatar_id":"","url":"https://api.github.com/users/cehbrecht","html_url":"https://github.com/cehbrecht","followers_url":"https://api.github.com/users/cehbrecht/followers","following_url":"https://api.github.com/users/cehbrecht/following{/other_user}","gists_url":"https://api.github.com/users/cehbrecht/gists{/gist_id}","starred_url":"https://api.github.com/users/cehbrecht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cehbrecht/subscriptions","organizations_url":"https://api.github.com/users/cehbrecht/orgs","repos_url":"https://api.github.com/users/cehbrecht/repos","events_url":"https://api.github.com/users/cehbrecht/events{/privacy}","received_events_url":"https://api.github.com/users/cehbrecht/received_events","type":"User","site_admin":false},"assignees":[{"login":"cehbrecht","id":4965260,"avatar_url":"https://avatars1.githubusercontent.com/u/4965260?v=4","gravatar_id":"","url":"https://api.github.com/users/cehbrecht","html_url":"https://github.com/cehbrecht","followers_url":"https://api.github.com/users/cehbrecht/followers","following_url":"https://api.github.com/users/cehbrecht/following{/other_user}","gists_url":"https://api.github.com/users/cehbrecht/gists{/gist_id}","starred_url":"https://api.github.com/users/cehbrecht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cehbrecht/subscriptions","organizations_url":"https://api.github.com/users/cehbrecht/orgs","repos_url":"https://api.github.com/users/cehbrecht/repos","events_url":"https://api.github.com/users/cehbrecht/events{/privacy}","received_events_url":"https://api.github.com/users/cehbrecht/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/bird-house/flyingpigeon/milestones/7","html_url":"https://github.com/bird-house/flyingpigeon/milestone/7","labels_url":"https://api.github.com/repos/bird-house/flyingpigeon/milestones/7/labels","id":3208899,"number":7,"title":"1.3","description":"","creator":{"login":"cehbrecht","id":4965260,"avatar_url":"https://avatars1.githubusercontent.com/u/4965260?v=4","gravatar_id":"","url":"https://api.github.com/users/cehbrecht","html_url":"https://github.com/cehbrecht","followers_url":"https://api.github.com/users/cehbrecht/followers","following_url":"https://api.github.com/users/cehbrecht/following{/other_user}","gists_url":"https://api.github.com/users/cehbrecht/gists{/gist_id}","starred_url":"https://api.github.com/users/cehbrecht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cehbrecht/subscriptions","organizations_url":"https://api.github.com/users/cehbrecht/orgs","repos_url":"https://api.github.com/users/cehbrecht/repos","events_url":"https://api.github.com/users/cehbrecht/events{/privacy}","received_events_url":"https://api.github.com/users/cehbrecht/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":4,"state":"open","created_at":"2018-03-22T10:28:09Z","updated_at":"2018-05-03T17:24:13Z","due_on":"2018-06-30T07:00:00Z","closed_at":null},"comments":3,"created_at":"2018-05-03T08:34:25Z","updated_at":"2018-05-03T19:39:40Z","closed_at":"2018-05-03T14:27:13Z","author_association":"OWNER","body":"This bug is reported by CRIM:\r\n\r\nI recently started working on the PAVICS project, and I have a bug to submit you, but I’m not sure where is the best place/project to submit it.\r\n \r\nWe have a common bug with the WPS services built on pywps, such as Malleefowl, Flyingpigeon and Hummingbird.\r\n\r\nOn each WPS request we perform on those services, an additional file descriptor gets opened on the services’ log file, for example, inside the Flyingpigeon Docker container, it’s the file `/opt/birdhouse/var/log/pywps/flyingpigeon.log.`\r\n \r\nConsequently, all log output gets duplicated by the number of times the gunicorn worker had previously processed requests… filling up our hard drives very rapidly.\r\n \r\nMy quick workaround is to add “--max-requests 1” to the gunicorn command line, so the workers are restarted after each requests.\r\n \r\nBut after longer investigation, I found out that the root cause of the problem is in `wsgi.py` of those services.\r\n \r\nFor example, Flyingpigeon is currently written like this:\r\n \r\n```\r\nimport os\r\nfrom pywps.app.Service import Service\r\n \r\nfrom .processes import processes\r\n \r\ndef application(environ, start_response):\r\n    app = create_app()\r\n    return app(environ, start_response)\r\n \r\n \r\ndef create_app(cfgfiles=None):\r\n    config_files = [os.path.join(os.path.dirname(__file__), 'default.cfg')]\r\n    if cfgfiles:\r\n        config_files.extend(cfgfiles)\r\n    if 'PYWPS_CFG' in os.environ:\r\n        config_files.append(os.environ['PYWPS_CFG'])\r\n    service = Service(processes=processes, cfgfiles=config_files)\r\n    return service\r\n```\r\n \r\nUnfortunately,  `create_app() ` is called on every request handled by the worker. Rewriting the `wsgi.py `like this fixes the problem:\r\n \r\n```\r\nimport os\r\nfrom pywps.app.Service import Service\r\n \r\nfrom .processes import processes\r\n \r\ndef create_app(cfgfiles=None):\r\n    config_files = [os.path.join(os.path.dirname(__file__), 'default.cfg')]\r\n    if cfgfiles:\r\n        config_files.extend(cfgfiles)\r\n    if 'PYWPS_CFG' in os.environ:\r\n        config_files.append(os.environ['PYWPS_CFG'])\r\n    service = Service(processes=processes, cfgfiles=config_files)\r\n    return service\r\n \r\napplication = create_app()\r\n```\r\n \r\n \r\nThanks!\r\n "},"comment":{"url":"https://api.github.com/repos/bird-house/flyingpigeon/issues/comments/386412492","html_url":"https://github.com/bird-house/flyingpigeon/issues/240#issuecomment-386412492","issue_url":"https://api.github.com/repos/bird-house/flyingpigeon/issues/240","id":386412492,"user":{"login":"ldperron","id":6599624,"avatar_url":"https://avatars1.githubusercontent.com/u/6599624?v=4","gravatar_id":"","url":"https://api.github.com/users/ldperron","html_url":"https://github.com/ldperron","followers_url":"https://api.github.com/users/ldperron/followers","following_url":"https://api.github.com/users/ldperron/following{/other_user}","gists_url":"https://api.github.com/users/ldperron/gists{/gist_id}","starred_url":"https://api.github.com/users/ldperron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldperron/subscriptions","organizations_url":"https://api.github.com/users/ldperron/orgs","repos_url":"https://api.github.com/users/ldperron/repos","events_url":"https://api.github.com/users/ldperron/events{/privacy}","received_events_url":"https://api.github.com/users/ldperron/received_events","type":"User","site_admin":false},"created_at":"2018-05-03T19:39:40Z","updated_at":"2018-05-03T19:39:40Z","author_association":"NONE","body":"Thanks! We will stay with the workaround for now, but I will make sure to remove the workaround when we upgrade any of the birds."}}
{"actor":{"display_login":"ldperron"}}