[libzip] Check kill operation for each type of job
Closed, ResolvedPublic

Description

The libzip plugin doesn't react to QThread::requestInterruption(), as bug #389290 shows.

This happens because zip_close() (where we actually write data to disk) is blocking and we cannot check QThread::currentThread()->isInterruptionRequested() like we usually do.

This probably affects also other types of job (delete, move, etc.), so we need to check all of them.

elvisangelaccio triaged this task as High priority.

Possible solution: call zip_discard(m_archive) in LibzipPlugin::doKill() (where m_archive stores the zip_t* returned by zip_open()).
Howewer this needs a mutex, since we are freeing m_archive from the main thread (while it was created in the secondary thread).

elvisangelaccio added a comment.EditedFeb 24 2018, 7:16 PM

Possible solution: call zip_discard(m_archive) in LibzipPlugin::doKill() (where m_archive stores the zip_t* returned by zip_open()).
Howewer this needs a mutex, since we are freeing m_archive from the main thread (while it was created in the secondary thread).

Not possible for the same reason: zip_close() is blocking, so LibzipPlugin::doKill() will always find the mutex locked... :/

(and without mutex, it will crash)

The test does can react to QThread::requestInterruption(), instead. It just doesn't currently do it.

elvisangelaccio moved this task from Backlog to In progress on the Ark board.Feb 25 2018, 12:37 PM
elvisangelaccio closed this task as Resolved.Oct 27 2018, 4:21 PM
elvisangelaccio claimed this task.

The test does can react to QThread::requestInterruption(), instead. It just doesn't currently do it.

Done with 0fba00d0186af24252754dc625bb2ae1b79f67e5