MKSG-MugunthKumar / MKNetworkKit

Modern NSURLSession based Networking Framework with built in authentication and HTTP 1.1 caching standards support for iOS 8+ devices
http://mk.sg/8w
3.06k stars 755 forks source link

Race Condition Between freezeOperations and checkAndRestoreFrozenOperations in MKNetworkEngine #451

Open kglee79 opened 9 years ago

kglee79 commented 9 years ago

If reachability changes quickly enough (which was occurring a bunch during unit testing, but less likely in real life situations), if checkAndRestoreFrozenOperations is called while freezeOperations is still running, ops can be stuck in a frozen state until the next reachability change. Below is an outline of what was happening when I was unit testing a piece of my app and also explains why I was randomly seeing that operations were not being completed once connectivity was restored...