Conn2Flow
All updates
Automation

Running a task manually can leave the web request

A task that restarts server services took down the very request that started it. It can now run in a separate process, and the panel says how isolated that process is.

The "Run now" button executed the task inside the web request itself. For almost every task, that is enough. For a task that restarts the PHP service, it is not: the restart ends the process serving the request, the browser gets an error and the task dies midway.

Regular scheduling never had this problem, because it already runs from the command line.

First attempt

The task now declares, in its own parameters, that it needs to run outside the request. The system starts it as a separate process and answers the panel at once. The one who knows a task restarts a service is the module that owns it, not the core.

Why that was not enough

Detaching the process from the session does not take it out of the service's process group. When the operating system restarts the service, it ends the whole group, the detached process included.

The solution

The system now probes three ways to start the process, from the most isolated to the least, and uses the first that works:

  • its own group, created by the service manager;
  • a local remote session, which is born in another group;
  • only a new session, as a last resort.

The third does not protect against the restart, and the panel says so: the answer reports which form was used and whether there is isolation. When none is available, the task runs as before.

Source: Core · BATCH-166/167

The Future is Hybrid: Human + AI.

Conn2Flow is the tool. If you need the Architect to design your company's strategy using this technology...

Hire Specialized Consulting