Skip to content

Commit 7dc6137

Browse files
Dropped support for wdb interactive debugger.
1 parent 19989e4 commit 7dc6137

File tree

3 files changed

+7
-71
lines changed

3 files changed

+7
-71
lines changed

README.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -306,19 +306,5 @@ the New Relic UI.
306306
New Relic provides a free Lite tier so there is no excuse for not using it.
307307
Learn about what your Python web application is really doing. [1]_
308308

309-
Using mod_wsgi express with wdb (Web Debugger)
310-
----------------------------------------------
311-
312-
If a fan of `wdb <https://github.com/Kozea/wdb>`_ for debugging your web
313-
application during development, and you already have that installed, you
314-
can use the ``--with-wdb`` option.
315-
316-
::
317-
318-
mod_wsgi-express start-server wsgi.py --with-wdb
319-
320-
You do not need to start the wdb server yourself, it will be automatically
321-
started and managed for you.
322-
323309
.. [1] Disclaimer: I work for New Relic and am the primary developer of
324310
the Python agent. So of course it is awesome. :-)

docs/release-notes/version-4.3.3.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ been explicitly set to define the user and the user is different to the
109109
user that Apache child worker processes run as. In other words, is
110110
different to the default Apache user.
111111

112+
2. The support for the ``wdb`` debugger was removed. Decided that it wasn't
113+
mainstream enough and not ideal that still required a separate service and
114+
port to handle debugging sessions.
115+
112116
New Features
113117
------------
114118

src/server/__init__.py

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -659,11 +659,6 @@ def find_mimetypes():
659659
process-group=express application-group=server-metrics
660660
"""
661661

662-
APACHE_WDB_CONFIG = """
663-
WSGIImportScript '%(server_root)s/wdb-server.py' \\
664-
process-group=express application-group=wdb-server
665-
"""
666-
667662
def generate_apache_config(options):
668663
with open(options['httpd_conf'], 'w') as fp:
669664
print(APACHE_GENERAL_CONFIG % options, file=fp)
@@ -718,15 +713,12 @@ def generate_apache_config(options):
718713
print(APACHE_INCLUDE_CONFIG % dict(filename=filename),
719714
file=fp)
720715

721-
if options['with_newrelic_platform'] or options['with_wdb']:
716+
if options['with_newrelic_platform']:
722717
print(APACHE_TOOLS_CONFIG % options, file=fp)
723718

724719
if options['with_newrelic_platform']:
725720
print(APACHE_METRICS_CONFIG % options, file=fp)
726721

727-
if options['with_wdb']:
728-
print(APACHE_WDB_CONFIG % options, file=fp)
729-
730722
_interval = 1.0
731723
_times = {}
732724
_files = []
@@ -873,7 +865,7 @@ class ApplicationHandler(object):
873865

874866
def __init__(self, entry_point, application_type='script',
875867
callable_object='application', mount_point='/',
876-
with_newrelic_agent=False, with_wdb=False, debug_mode=False,
868+
with_newrelic_agent=False, debug_mode=False,
877869
enable_debugger=False):
878870

879871
self.entry_point = entry_point
@@ -916,9 +908,6 @@ def __init__(self, entry_point, application_type='script',
916908
if with_newrelic_agent:
917909
self.setup_newrelic_agent()
918910

919-
if with_wdb:
920-
self.setup_wdb()
921-
922911
self.debug_mode = debug_mode
923912
self.enable_debugger = enable_debugger
924913

@@ -941,10 +930,6 @@ def setup_newrelic_agent(self):
941930
self.application = newrelic.agent.WSGIApplicationWrapper(
942931
self.application)
943932

944-
def setup_wdb(self):
945-
from wdb.ext import WdbMiddleware
946-
self.application = WdbMiddleware(self.application)
947-
948933
def setup_post_mortem_debugging(self):
949934
self.application = PostMortemDebugger(self.application)
950935

@@ -1037,7 +1022,6 @@ def __call__(self, environ, start_response):
10371022
with_newrelic_agent = %(with_newrelic_agent)s
10381023
newrelic_config_file = '%(newrelic_config_file)s'
10391024
newrelic_environment = '%(newrelic_environment)s'
1040-
with_wdb = %(with_wdb)s
10411025
reload_on_changes = %(reload_on_changes)s
10421026
debug_mode = %(debug_mode)s
10431027
enable_debugger = %(enable_debugger)s
@@ -1087,8 +1071,7 @@ def output_profiler_data():
10871071
handler = mod_wsgi.server.ApplicationHandler(entry_point,
10881072
application_type=application_type, callable_object=callable_object,
10891073
mount_point=mount_point, with_newrelic_agent=with_newrelic_agent,
1090-
with_wdb=with_wdb, debug_mode=debug_mode,
1091-
enable_debugger=enable_debugger)
1074+
debug_mode=debug_mode, enable_debugger=enable_debugger)
10921075
10931076
reload_required = handler.reload_required
10941077
handle_request = handler.handle_request
@@ -1203,36 +1186,6 @@ def generate_server_metrics_script(options):
12031186
with open(path, 'w') as fp:
12041187
print(SERVER_METRICS_SCRIPT % options, file=fp)
12051188

1206-
WDB_SERVER_SCRIPT = """
1207-
from wdb_server import server
1208-
try:
1209-
from wdb_server.sockets import handle_connection
1210-
except ImportError:
1211-
from wdb_server.streams import handle_connection
1212-
1213-
from tornado.ioloop import IOLoop
1214-
from tornado.options import options
1215-
from tornado.netutil import bind_sockets, add_accept_handler
1216-
from threading import Thread
1217-
1218-
def run_server():
1219-
ioloop = IOLoop.instance()
1220-
sockets = bind_sockets(options.socket_port)
1221-
for socket in sockets:
1222-
add_accept_handler(socket, handle_connection, ioloop)
1223-
server.listen(options.server_port)
1224-
ioloop.start()
1225-
1226-
thread = Thread(target=run_server)
1227-
thread.setDaemon(True)
1228-
thread.start()
1229-
"""
1230-
1231-
def generate_wdb_server_script(options):
1232-
path = os.path.join(options['server_root'], 'wdb-server.py')
1233-
with open(path, 'w') as fp:
1234-
print(WDB_SERVER_SCRIPT, file=fp)
1235-
12361189
WSGI_CONTROL_SCRIPT = """
12371190
#!/bin/sh
12381191
@@ -1747,10 +1700,6 @@ def check_percentage(option, opt_str, value, parser):
17471700
default='', help='Specify the name of the environment section '
17481701
'that should be used from New Relic agent configuration file.'),
17491702

1750-
optparse.make_option('--with-wdb', action='store_true', default=False,
1751-
help='Flag indicating whether the wdb interactive debugger '
1752-
'should be enabled for the WSGI application.'),
1753-
17541703
optparse.make_option('--with-php5', action='store_true', default=False,
17551704
help='Flag indicating whether PHP 5 support should be enabled.'),
17561705

@@ -2232,9 +2181,6 @@ def _cmd_setup_server(command, args, options):
22322181
if options['with_newrelic_platform']:
22332182
generate_server_metrics_script(options)
22342183

2235-
if options['with_wdb']:
2236-
generate_wdb_server_script(options)
2237-
22382184
generate_apache_config(options)
22392185
generate_control_scripts(options)
22402186

0 commit comments

Comments
 (0)