- /* FIXME: If there are objects that are in the write queue
- * so we can't delete them we should block here, at the cost of
- * slowness as the object cache memory limit is considered
- * n hard limit. */
+ /* Was not able to fix a single object... we should check if our
+ * IO queues have stuff in queue, and try to consume the queue
+ * otherwise we'll use an infinite amount of memory if changes to
+ * the dataset are faster than I/O */
+ if (listLength(server.cache_io_queue) > 0) {
+ cacheScheduleIOPushJobs(0);
+ waitEmptyIOJobsQueue();
+ processAllPendingIOJobs();
+ return REDIS_OK;
+ }
+ /* Nothing to free at all... */