php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59343 apc_fetch() does not check for cache is invalidated
Submitted: 2010-08-07 17:28 UTC Modified: 2010-08-07 17:42 UTC
From: fruit dot dev at gmail dot com Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: 5.2.13 OS: Fedora 10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fruit dot dev at gmail dot com
New email:
PHP Version: OS:

 

 [2010-08-07 17:28 UTC] fruit dot dev at gmail dot com
Description:
------------
When I use "sleep", to wait until cache "fruit" to be invalidated, the cache still exists and contains the data.

Reproduce code:
---------------
<?php

  apc_clear_cache('user');

  apc_store('fruit', 'grape', 1);

  sleep(3);

  $has = null;
  var_dump(apc_fetch('fruit', $has));

  var_dump($has);

Expected result:
----------------
Script output should be:

NULL
false

Actual result:
--------------
Be running this script i got:

string 'grape' (length=5)
boolean true

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-07 17:42 UTC] rasmus@php.net
Generally you never do a store and a fetch from within the 
same request.  It makes very little sense to do so since you 
have the data you stored already.  In order to save a system 
call, apc_fetch() call uses the request time which is set at 
the start of the request to check the ttl of the entry.  If 
you really want to store and fetch from within the same 
request set:

apc.use_request_time = 0
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 23:01:30 2024 UTC