Skip to content

freecad: fckill + reloader watchdog for a stalled live session #175

Description

@St0nefish

Problem

The fclive reloader (a QTimer-based watcher) stalls, and there is no supported
way to force-recover a wedged live session. When it happens, the only recourse
today is the user hand-closing the GUI (Cmd-Q), which risks poisoning the next
launch because fcquit's cleanup never runs.

Migrated from freecad-plugin-gaps.md (bug/friction item 1), quoted in full:

fclive + fcrun clobber wedges the reloader. Running the headless
fcrun (or anything that writes the same WW_OUT/.FCStd) while a fclive
session holds that file open makes FreeCAD mark the doc dirty / detect an
external change, and the QTimer-based reloader silently stops firing (only
"rebuild #1" ever logged). Recovery is painful: fcquit can't complete
because the event loop is wedged, and it (correctly) refuses to kill.

  • Fix ideas: SKILL.md should warn "never point fcrun at the same folder a
    live session owns; render/validate to a temp dir." Better: give fclive a
    way to self-validate (dump clashes/cutlist without a separate fcrun),
    and/or have the live doc suppress the "changed on disk" reload prompt. A
    stale .stop file also has to be removed by hand before relaunch.
  • RECURRED without any clobbering — the QTimer reloader stalled on its own
    right after a big rebuild that dumps a long cutlist()/cutplan() into the
    Report View (Qt logs "table ... out of bounds, Resizing table model" as the
    last line each time). Strong smell that heavy per-rebuild Report View output
    stalls the event loop. Fixes: (a) don't run verbose cutlist/cutplan on every
    live rebuild (gate behind a flag / on-demand); (b) give the reloader a
    watchdog so a stalled QTimer restarts instead of silently dying; (c) make
    fcquit able to force-recover a wedged session without the user hand-closing
    it (Cmd-Q every time is rough).
  • Need a fckill / force-recover tool. When the reloader wedges, the only
    recourse is the user hand-closing the GUI (Cmd-Q). There should be a
    supported force-kill that also cleans up afterward (clear FreeCAD's recovery
    breadcrumbs so the next launch doesn't hit the invisible "original file
    corrupted" modal, and remove the stale .stop/.snap files). Killing by
    hand today risks poisoning the next launch precisely because that cleanup
    isn't done.

Note: the SKILL.md warning about fcrun/fcrender clobbering a live session
(the first bullet above) has already shipped. What's still open is the tail
of this item — a watchdog for a QTimer reloader that stalls on its own (e.g.
after a heavy Report View dump), and a fckill force-recover tool that also
does the FreeCAD recovery-breadcrumb / stale .stop/.snap cleanup a manual
kill skips. This needs care around the event loop and the documented
"never kill, only clean shutdown" invariant fcquit currently upholds.

Source

Migrated from freecad-plugin-gaps.md in the freecad-woodworking project
(bug/friction item 1) — that file's "still open" recap calls this out
explicitly as: "reloader watchdog / fckill (#1 tail — event-loop and a
stated no-kill invariant, needs care)".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions