Opened 3 years ago

Last modified 3 years ago

#355 new defect

We get "PHP Fatal error:  Cannot redeclare class" after calling to: xcache_clear_cache(XC_TYPE_PHP);

Reported by: ariel.snir Owned by: moo
Priority: critical Milestone: undecided
Component: cacher Version: 3.2.0
Keywords: Cannot redeclare class Cc:
Application: PHP Version: 5.5.21
Other Exts: SAPI: Irrelevant
Probability: Blocked By:
Blocking:

Description

Summary:
We get "PHP Fatal error:  Cannot redeclare class" after calling to: xcache_clear_cache(XC_TYPE_PHP);

Description:
Hello,
We get the following error:
PHP Fatal error:  Cannot redeclare class
after calling to xcache_clear_cache(XC_TYPE_PHP);

i.e.
PHP Fatal error:  Cannot redeclare class Firm\\Lib\\Exception\\NotLoadedException in /srv/firm/vendor/Firm/kafka/src/Kafka/Message.php on line 10

Error appears after calling clear cache but not always.

This error occurs almost 1k times in one minute.
When restarting the apache this error stops.

Configuration and version details:
OS: CentOS release 6.6 (Final)
Apache version: Apache/2.2.15 (CentOS) PHP/5.5.21 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips
PHP version: PHP Version 5.5.21
xCache version: XCache v3.2.0
xCache config:
xcache.coredump_directory => no value => no value
xcache.disable_on_crash => Off => Off
xcache.experimental => Off => Off
xcache.test => Off => Off
xcache.admin.enable_auth => On => On
xcache.allocator => bestfit => bestfit
xcache.cacher => On => On
xcache.count => 24 => 24
xcache.gc_interval => 300 => 300
xcache.mmap_path => /dev/zero => /dev/zero
xcache.readonly_protection => Off => Off
xcache.shm_scheme => mmap => mmap
xcache.size => 1G => 1G
xcache.slots => 8K => 8K
xcache.stat => Off => Off
xcache.ttl => 3600 => 3600
xcache.var_allocator => bestfit => bestfit
xcache.var_count => 1 => 1
xcache.var_gc_interval => 300 => 300
xcache.var_maxttl => 3600 => 3600
xcache.var_namespace => no value => no value
xcache.var_namespace_mode => 0 => 0
xcache.var_size => 4M => 4M
xcache.var_slots => 8K => 8K
xcache.var_ttl => 3600 => 3600
xcache.coveragedump_directory => no value => no value
xcache.coverager => Off => Off
xcache.coverager_autostart => On => On
xcache.optimizer => Off => Off

Change History (4)

comment:1 Changed 3 years ago by ariel.snir

XCache Optimizer v3.2.0
XCache Cacher v3.2.0
XCache Coverager v3.2.0

comment:2 follow-up: Changed 3 years ago by moo

Can you provide a short reproducable code?

comment:3 in reply to: ↑ 2 Changed 3 years ago by ariel.snir

Replying to moo:

Can you provide a short reproducable code?

I can't put my finger on a specific code.
I can tell you that the site has heavy load and a lot of traffic.
An that it happens after calling to xcache_clear_cache(XC_TYPE_PHP);

comment:4 Changed 3 years ago by moo

I can't do much without reproducing the problem. There is some coding way that is cache unfriendly. e.g.:
the condition class definition: if (something) { class ... }
wrong order of definition: class A extends B { }; class B{}
branch merging inherit: both a.php and b.php defines "class Base "while c.php has "class Child extends Base", sometimes a.php sometimes b.php is included before c.php

Last edited 3 years ago by moo (previous) (diff)
Note: See TracTickets for help on using tickets.