Fix track cache to defer delete and save operations

Bug #1366157 reported by Owen Williams
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Medium
RJ Skerry-Ryan

Bug Description

See: http://pastebin.com/wa91JJJh
http://pastebin.com/vn9ns1Mf

When an item is inserted into a QCache and the cache is full, it evicts an existing item. The eviction takes place immediately. In Mixxx, this can cause the TrackPointer refcount to go to zero, so the deleter is called, and this can immediately trigger a track save, and that can trigger a UI update, and then the UI update dives back in and tries to read the cache, which can trigger a second reentrant insert.

There are a couple ways to fix this, and we should do both to prevent future issues:

1. Cache evictions shouldn't immediately trigger a save and delete. TrackPointer's Deleter should call deleteLater, and the destructor for TIO should do the saving.
2. QCache should be rewritten so that cache eviction happens *after* the new item has been inserted

Owen Williams (ywwg)
Changed in mixxx:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

I think an underlying problem is that TrackInfoObject refcounts dropping to 0 can cause a lot of things (database and GUI-wise) to happen that you might not expect. One way to fix this is to change TIO destruction order so that refcount dropping to zero queues the TIO for deletion and then the deletion is done via the Qt event loop.

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :
Revision history for this message
RJ Skerry-Ryan (rryan) wrote : Re: [Bug 1366157] Re: Fix track cache to defer delete and save operations

yea, this should be a more general fix

On Fri, Sep 5, 2014 at 12:28 PM, Sean M. Pappalardo <
<email address hidden>> wrote:

> So is this then fixed by https://github.com/mixxxdj/mixxx/pull/331 ?
>
> --
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
> https://bugs.launchpad.net/bugs/1366157
>
> Title:
> Fix track cache to defer delete and save operations
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mixxx/+bug/1366157/+subscriptions
>

Changed in mixxx:
assignee: nobody → RJ Ryan (rryan)
status: Confirmed → In Progress
Max Linke (max-linke)
Changed in mixxx:
status: In Progress → Fix Committed
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
RJ Skerry-Ryan (rryan)
Changed in mixxx:
milestone: none → 2.0.0
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/7570

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.