Skip to content

Question: WSGI subprocess #55

@smiles3983

Description

@smiles3983

Im trying to make this work when my server is started as a subprocess. We use Bottle and Gevent. when I use the AUTOWRAPT_BOOTSTRAP=autodynatrace variable, I see the AWS pods my app is running on, and I see external calls to external API's and Databases, but I dont see anything incoming to my web server.

from gevent import monkey
import json

monkey.noisey = False
monkey.patch_all(subprocess=True, thread=True)
from gevent.pywsgi import WSGIServer
from bottle import route, run, static_file, request, template, error, response, default_app, redirect, ServerAdapter, server_names, HTTPResponse

def main():
    server_names['gevent'] = GeventServer
    application = default_app()
    server_settings = json.loads('{"server":"gevent"}'))
    application.run(**server_settings, host='0.0.0.0', port=8443, reloader=False,
                        keyfile=os.environ.get('HTTPS_PRIVATE_KEY_PATH', ''),
                        certfile=os.environ.get('HTTPS_PUBLIC_CERT_PATH', ''))

class GeventServer(ServerAdapter):
    """ For asynchronous responses. """

    def run(self, handler):
        if cfg.bottle_run_ssl.upper() == 'TRUE':
            app = WSGIServer((self.host, 8443), handler, keyfile=os.environ.get('HTTPS_PRIVATE_KEY_PATH', ''),
                             certfile=os.environ.get('HTTPS_PUBLIC_CERT_PATH', ''))
        else:
            app = WSGIServer((self.host, 8080), handler)
        app.serve_forever()

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions