kio: suspend slaves to prevent data going in or out

that design flaw needs a proper fix but it will not happen until I rewrite
everything job-related

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-03 09:13:47 +03:00
parent 053420e816
commit da1448658a

View file

@ -131,10 +131,20 @@ bool SlaveInterface::isAlive() const
void SlaveInterface::suspend()
{
m_connection->suspend();
// TODO: this is not a proper way to suspend slaves (tho it works), e.g. for remote connections
// a server may decide to just close the connection because there is no reponse from the slave
// for some time but otherwise data keeps getting pumped in or out. for example it works for
// file slave but not for the curl slave
if (m_pid) {
::kill(m_pid, SIGSTOP);
}
}
void SlaveInterface::resume()
{
if (m_pid) {
::kill(m_pid, SIGCONT);
}
m_connection->resume();
}