Debugging via pydev in PyCharm fails after change to use oslo.service

Bug #1521266 reported by Chad Roberts
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sahara
Fix Released
Low
Chad Roberts

Bug Description

Running sahara-all via PyCharm to debug (via pydevd) now fails whereas before the change to use the oslo.service launcher, it worked.

If the same configuration (that was working) is launched in Debug mode, the service appears to start, but if you submit any requests, there is no action ever taken on them.

You can still launch the configuration in "Run" (not with debug) mode and the sahara service seems to run and respond just fine.

I am guessing this might be an issue related to any pydevd style debugging (used by PyCharm and Eclipse), but I have not tested anything outside of PyCharm (versions 4.5 and 5.0).

Note: If I locally revert the change to use oslo.service, my debugging sessions run as they always have.

Revision history for this message
Chad Roberts (croberts) wrote :

For what it's worth, it looks like I can still successfully run and debug sahara-engine via PyCharm. I'm guessing there's something about how we are launching the WSGI app now that it's done via oslo.service.

Revision history for this message
Chad Roberts (croberts) wrote :

I was able to produce this behavior from the tip of master on both Fedora22 and Ubuntu 15.10

Changed in sahara:
importance: Undecided → Low
milestone: none → next
Revision history for this message
Chad Roberts (croberts) wrote :

I'm lacking familiarity with oslo.service, but making the following tweak to sahara/main.py seems to get my debugging back on track.

def launch_api_service(launcher, service):
    launcher.launch_service(service, workers=CONF.api_workers)
    # somehow, doing service.start() in this breakpoint seems to make something
    # start working--no idea why this is needed in debug mode, found by accident
    service.start()
    launcher.wait()

Revision history for this message
Chad Roberts (croberts) wrote :

Hmm, looks like the above tweak only works when running sahara-api, not sahara-all

Revision history for this message
Vitalii Gridnev (vgridnev) wrote :
Changed in sahara:
assignee: nobody → Chad Roberts (croberts)
milestone: next → mitaka-1
status: New → Triaged
status: Triaged → In Progress
Changed in sahara:
milestone: mitaka-1 → mitaka-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to sahara (master)

Reviewed: https://review.openstack.org/251971
Committed: https://git.openstack.org/cgit/openstack/sahara/commit/?id=673952f0240ac6484ecafeddb5502f68646485db
Submitter: Jenkins
Branch: master

commit 673952f0240ac6484ecafeddb5502f68646485db
Author: Chad Roberts <email address hidden>
Date: Tue Dec 1 11:59:29 2015 -0500

    Explicitly calling start for sahara-api in sahara-all

    Now calling launch_api_service and service.start() for
    sahara-api when launching sahara-all to get the
    api server to start, even in debug mode.

    Change-Id: I8668a70b99e3f1fba98ec9df783b7962b9632037
    Closes-Bug: #1521266

Changed in sahara:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/sahara 4.0.0.0b2

This issue was fixed in the openstack/sahara 4.0.0.0b2 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.