<table><tr><td style="">TallFurryMan created this revision.<br />TallFurryMan added reviewers: mutlaqja, wreissenberger.<br />Herald added a project: KDE Edu.<br />Herald added a subscriber: kde-edu.<br />TallFurryMan requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D15339">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Fixed a wrong state in management of unparking error, causing unparking errors to leave the park state busy unparking.<br />
Reworked parkMount like unParkMount, managing D-Bus errors properly.<br />
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.<br />
Added a safeguard against a null pointer dereference for edge cases leading to null job execution.<br />
Fixed startup state when Scheduler is stopping, causing unparked states to never be checked properly.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>A straightforward way to reproduce the main issue that is fixed here is to use "culmination_no_twilight".</p>

<p>Start the Scheduler, observe as:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Observatory is started, and elements unparked</li>
<li class="remarkup-list-item">Scheduler selects one of the jobs, eventually processes it, then sleeps waiting for the next</li>
<li class="remarkup-list-item">Stop the Scheduler</li>
<li class="remarkup-list-item">Restart the Scheduler</li>
</ul>

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

<p>From there, various situation may be tested with parking states in order to desynchronize the parking engine from the mount actual state.<br />
Notable is that this differential also restores connection to an INDI mount driver that has disconnected.<br />
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).</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R321 KStars</div></div></div><br /><div><strong>BRANCH</strong><div><div>bugfix__engine_states_on_scheduler_stop (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D15339">https://phabricator.kde.org/D15339</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>kstars/ekos/scheduler/scheduler.cpp</div></div></div><br /><div><strong>To: </strong>TallFurryMan, mutlaqja, wreissenberger<br /><strong>Cc: </strong>kde-edu, narvaez, apol<br /></div>