[16.08 regression] Loop of ListJobs after creating a zip file
Closed, ResolvedPublic

Description

Steps to reproduce:

  • Create a new zip archive
  • Add a file

Ark starts an endless loop of new ListJobs. Libarchive is not affected.

elvisangelaccio updated the task description. (Show Details)

This happen even if I revert the multi-volume commit... :/

It seems this bug is introduced by commit 07269ec72e0f

It seems this bug is introduced by commit 07269ec72e0f

Actually, by commit 32832943

In Part::updateActions() we call Archive::encryptionType() which calls listIfNotListed(). Unfortunately in this situation m_hasBeenListed is still false and that's why we have this endless loop of ListJobs.

So the root cause is a race condition when ListJob emits result. Both ArchiveModel::slotLoadingFinished() and Archive::onListFinished() are connected to this signal. But the former triggers a chain of calls that ends up calling properties of Archive that are set by the concurrent Archive::onListFinished() method (including Archive::encryptionType())...

elvisangelaccio added a comment.EditedJul 22 2016, 11:36 AM

An ugly workaround (which fixes the endless loop) is setting m_hasBeenListed = true in Archive::list().
But this would be wrong (what if the returned job is never started?) and the race condition would be still there.

I don't really see an easy solution for this mess... :/

elvisangelaccio moved this task from In progress to Done on the Ark board.Jul 23 2016, 3:34 PM
elvisangelaccio closed this task as Resolved.Aug 16 2016, 5:15 PM
elvisangelaccio claimed this task.