Fix mount not unparking after scheduler stops
ClosedPublic

Authored by TallFurryMan on Sep 7 2018, 8:53 PM.

Details

Summary

Fixed a wrong state in management of unparking error, causing unparking errors to leave the park state busy unparking.
Reworked parkMount like unParkMount, managing D-Bus errors properly.
Fixed transitions to un/parked states, so that those states now match the current state of the mount instead of an expected transition in the state machine.
Added a safeguard against a null pointer dereference for edge cases leading to null job execution.
Fixed startup state when Scheduler is stopping, causing unparked states to never be checked properly.

Test Plan

A straightforward way to reproduce the main issue that is fixed here is to use "culmination_no_twilight".

Start the Scheduler, observe as:

  • Observatory is started, and elements unparked
  • Scheduler selects one of the jobs, eventually processes it, then sleeps waiting for the next

Then stop , and restart the Scheduler.

Without the fix, Scheduler repeatedly logs "Mount unparked", unable to request any element to unpark (actually unable to restart the observatory properly).
With the fix, Scheduler goes through the different steps of the observatory startup, unparking elements properly.

From there, various situation may be tested with parking states in order to desynchronize the parking engine from the mount actual state.
Notable is that this differential also restores connection to an INDI mount driver that has disconnected.
This restoration is done as part of the observatory startup, and a loss of connection during capture is still not managed (except by a subsequent failing guide).

Diff Detail

Repository
R321 KStars
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
TallFurryMan created this revision.Sep 7 2018, 8:53 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptSep 7 2018, 8:53 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
TallFurryMan requested review of this revision.Sep 7 2018, 8:53 PM
TallFurryMan edited the test plan for this revision. (Show Details)Sep 8 2018, 7:50 PM
wreissenberger accepted this revision.Sep 9 2018, 12:42 PM

Looks good, I could reproduce the problem and checked it being fixed against simulators.

This revision is now accepted and ready to land.Sep 9 2018, 12:42 PM

@mutlaqja Could we merge this soon?

I'm putting all on hold until DBus branch is merged back to master. So hopefully with a day or two.

Actually, I can merge this since I didn't start on the scheduler yet.

mutlaqja accepted this revision.Sep 11 2018, 2:13 PM
This revision was automatically updated to reflect the committed changes.