PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Bug #2348

incorrect warning about insufficient memory

Details

#2348incorrect warning about insufficient memory
Submitted2004-09-16 08:39 UTC
Fromswen dot thuemmler at telefonica dot de
Assignedrasmus
StatusClosed
PHP VersionIrrelevant
OSsolaris 2.8
Roadmaps(Not assigned)

Comments

[2004-09-16 08:39 UTC] swen dot thuemmler at telefonica dot de

Description:
------------
I think there is an incorrect warning given when apc_cache_insert() fails,
because another process already cached a file. In apc_main.c we have:
if (!apc_cache_insert(APCG(cache), key, cache_entry, t)) {
apc_cache_free_entry(cache_entry);
apc_cache_expunge(APCG(cache),t);
/* apc_log(APC_WARNING, "(apc_cache_insert) unable to cache '%s': insufficient " "shared memory available", h->opened_path); */
}
and in apc_cache.c, there is:
if (key_equals((*slot)->key.data.file, key.data.file)) {
/* If existing slot for the same device+inode is older, remove it and insert the new version */
if ((*slot)->key.mtime < key.mtime) {
remove_slot(cache, slot);
break;
}
UNLOCK(cache);
return 0;
}

So it returns 0, when the same file is already cached by another process and should not be cached again. Question is, should the function return 1 in this case, or should the warning be moved into the function, given only when there is really no memory left?

I'll have to check, whether this accounts for my comment on bug #1583 - the message might have been a red herring.

Greetings, Swen

[2004-09-16 08:51 UTC] swen dot thuemmler at telefonica dot de

Nope, bug #1583 is unaffected, I'll add my comments there.

--Swen