Incorrect stop of the schedulers

Description

Best regards
Palich.ru Development Team

Environment

None

Attachments

2

Activity

Martin Schönbeck 
May 9, 2020 at 8:16 PM
(edited)

triaged by as reproducible in 7.1z. When starting the process manually even with several reloads and after waiting of the ten minutes scheduler interval of the process the process kept stopped. The process took about 25 seconds. After starting the process and then clicking “stop all” it took several seconds until control output appeared (so the process was running when “stop all” was clicked) but it never got reactivated without clicking start.

Second test was to wait until the process was started automatically by the scheduler. Then it was reproducible as described in the abovementioned thread.

Priority changed to minor because as workaround the process can be stopped separately after finishing it’s current run.

For information I have added the relevant parts of the log.

Heng Sin Low 
May 9, 2020 at 12:15 PM
(edited)

Patch suggested in the google group discussion above:

  1. In methods AdempiereServerMgr.stop() and AdempiereServerMgr.stopAll() need change parameter in command.

    server.scheduleFuture.cancel(false);

    This will ended the process without errors and stop the thread

  2. You must add validation in method AdempiereServerMgr.ServerWrapper.run() for validation "InterruptedException"

    @Override public void run() { server.run(); if (!isInterrupted()) scheduleFuture = Adempiere.getThreadPoolExecutor().schedule(this, server.getSleepMS(), TimeUnit.MILLISECONDS); }

This will not allowed run planning next start this scheduler.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created April 4, 2018 at 8:06 AM
Updated December 1, 2020 at 5:25 PM
Resolved October 1, 2020 at 5:16 PM