Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB 접속이 안정적이지 않은 경우 빈 값이 캐싱되는 문제 #2308

Open
kijin opened this issue Sep 26, 2018 · 1 comment
Open
Labels
Milestone

Comments

@kijin
Copy link
Contributor

kijin commented Sep 26, 2018

DB 접속이 안정적이지 않은 경우 (호스팅 서버 장애, 서버 재부팅 직후 등) 빈 값이나 불완전한 데이터가 캐싱되는 문제가 있습니다. 그러면 DB 문제가 해소된 후에도 잘못 캐싱된 데이터를 계속 사용하게 되어 여러 가지 문제가 발생하는 것은 물론, 사용자가 문제의 원인을 찾기도 무척 어렵습니다.

특히 ModuleModel에서 이런 문제가 자주 발생합니다. 모듈 정보가 잘못 캐싱되면 홈페이지 전체가 404 오류를 뿜거나, 모듈 설정이 제대로 적용되지 않거나, 로그인이 되지 않는 등, 코어와 서드파티 전반에 걸쳐 다양한 부작용이 나타납니다.

if($oCacheHandler->isSupport())
{
    $oCacheHandler->put($cache_key, $output->data);
}

이런 구조로 되어 있는 코드가 많은데,

if($oCacheHandler->isSupport() && $output->toBool())
{
    $oCacheHandler->put($cache_key, $output->data);
}

이런 구조로 바꾸어서 잘못된 데이터가 캐싱되는 것을 방지해야 하겠습니다. 중간에 데이터를 가공하는 과정이 있는 경우에는 적당한 지점에서 $output->toBool()을 확인해 주고요.

@ghost ghost self-assigned this Sep 27, 2018
@ghost ghost added this to the 1.11-next milestone Sep 27, 2018
@gaejabong
Copy link
Contributor

저도 비슷한 문제를 겪고 있습니다. 특정시간대 스토리지의 부하로 인해 DB Connection도 일시적으로 급격히 증가하는데 그때 로그인이 잘 안 되는 문제가 발생하고 있네요.

@ghost ghost added the type/bug label Oct 10, 2018
kijin added a commit to rhymix/rhymix that referenced this issue Oct 10, 2018
kijin added a commit to rhymix/rhymix that referenced this issue Oct 10, 2018
@ghost ghost modified the milestones: 1.11.2, 1.11-next Dec 11, 2018
@ghost ghost removed their assignment Mar 14, 2020
@xpressengine xpressengine deleted a comment from kms0219kms Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants