Alamofire / AlamofireImage

AlamofireImage is an image component library for Alamofire
MIT License
3.99k stars 523 forks source link

Multithreaded reader writers issue with ImageCache module #382

Closed eSpecialized closed 5 years ago

eSpecialized commented 5 years ago

What did you do?

ImageCache module was found removing images from the cache concurrently. This occasionally causes crashing in our Application when the cache approaches a full state. Any add/remove actions should be wrapped under the synchronizationQueue with the barrier option.

What did you expect to happen?

ImageCache should function without issue.

What happened instead?

ImageCache crashes once cache fills on occasion.

Alamofire Environment

Alamofire version:

Demo Project

None provided.

Modifying any imageCache test to use multiple DispatchQueue’s to add/remove from the imageCache will present the crash bug. Notes: It should add/remove 100’s of times if not 1000’s, and surpass the cache Limit many times to cause the bug to present.

jshier commented 5 years ago

This has been fixed in #387 and will be released as 4.0.0-beta.6.