Opened 3 weeks ago

Closed 13 days ago

#867 closed defect (fixed)

quitting arb via macro causes problems

Reported by: westram Owned by: westram
Priority: major Milestone:
Component: ARB_NTREE Version: SVN
Keywords: Cc:

Description (last modified by westram)

When playing back a macro which quits arb, problems arise.

Reproduce:

Playback a macro containing:

BIO::remote_action($gb_main,'ARB_NT','ARB_NT/QUIT');
ARB::close($gb_main);

Observations:

  • BIO::remote_action never returns
  • ARB::close is never reached
  • socket used to communicate between ARB and the macro is not correctly closed, resulting in errors like
    Client (pid=14832) terminating after failure to contact database (Broken pipe).[waiting for DBENTRY 'tmp/remote/ARB_NT/authAck']
    [found DBENTRY 'tmp/remote/ARB_NT/authAck']
    
  • afterwards the arb_launcher sometimes detects arb processes as 'still running'.
    These may be any of the following:
    • the still running macro (probably not, it claimed to have terminated, see error above)
    • arb_ntree; possible; arb_launcher reports:
      .../arb_launcher: line 25: 14820 Killed: 9               $CMD
      [arb_launcher[0]: 'arb_ntree --execute /Users/.../example.amc working-db.arb' has terminated with error 137]
      
    • ???
  • after that the arb script fails to remove directories
    rmdir: /Users/jag22/.arb_prop/logs/20250725_012532.14911: Directory not empty
    
    This behavior is unwanted (but is expected to happen under these circumstances).
  • if arb_ntree reports an error (see above), the whole script stops with message
    [press ENTER or wait 3 days]
    
    which is not useful when trying to run arb automated.

Required fixes:

  • change macro execution (of action ARB_NT/QUIT) such that the macro terminates before arb (V) by [19513]
  • avoid that arb_ntree is killed by arb_launcher (X) unwise. required e.g. if merge-tool is running and has dead-locked for some reason.
  • [optional] fix compressing logs and removal of directory
  • add special mode for arb script, which avoids the requirement to press a key when arb crashes. Shall return different exitcode in that case. (V) with [19515] by introducing an environment variable.
  • avoid question "sure to quit?" (V) by [19514]

Attachments (3)

save-and-terminate.amc (932 bytes) - added by westram 3 weeks ago.
arb macro that saves the db and terminates arb. macro itself continues running.
provoke-arb-exit-error.amc (424 bytes) - added by westram 13 days ago.
macro provoking arb to exit with code!=0
quit-and-trigger-are-you-sure-question.amc (552 bytes) - added by westram 13 days ago.
will trigger "are you sure?"-prompt in NDEBUG versions ⇐ r19513

Download all attachments as: .zip

Change History (9)

comment:1 Changed 3 weeks ago by westram

  • Description modified (diff)

comment:2 Changed 3 weeks ago by westram

  • Description modified (diff)

comment:3 Changed 3 weeks ago by westram

  • Owner changed from devel to westram
  • Status changed from new to _started

Changed 3 weeks ago by westram

arb macro that saves the db and terminates arb. macro itself continues running.

comment:4 Changed 3 weeks ago by westram

Use the attached macro from CLI:

arb --execute save-and-terminate demo.arb

Note, that this will save demo.arb as ~/tmp/savename.arb

Behavior:

  • r19512: crashes
  • r19513:
    • waits for termination (click to terminate the macro) or
    • gets forced-quit after 100s (still crashes).

comment:5 Changed 3 weeks ago by westram

  • Description modified (diff)

comment:6 Changed 13 days ago by westram

  • Description modified (diff)
  • Resolution set to fixed
  • Status changed from _started to closed

Changed 13 days ago by westram

macro provoking arb to exit with code!=0

Changed 13 days ago by westram

will trigger "are you sure?"-prompt in NDEBUG versions ⇐ r19513

Note: See TracTickets for help on using tickets.