kio: remove the job from the queue and unlock the mutex on failure to create the slave

if the mutex is not unlocked deadlock occurs, if the job is not removed
from the queue it will be attempted to start it again

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-12 06:10:01 +03:00
parent 5f43d4a86c
commit dfd76bcd04

View file

@ -180,6 +180,8 @@ void Scheduler::slotStartJob()
slave = SlaveInterface::createSlave(protocol, url, error, errortext);
if (!slave) {
kError(7006) << "could not create slave" << errortext;
iter.remove();
locker.unlock();
job->slotError(error, errortext);
return;
}