bartv
(Bart )
10월 20, 2023, 5:57오전
1
저희 인스턴스에서 템플릿 목록을 로드하는 데 시간이 꽤 오래 걸리는 경우가 많습니다(5~10초 정도)가, 혹은 긴 대기 끝에 502 오류로 실패하기도 합니다. 총 15개의 템플릿이 있으며, 이 문제를 제외하면 Discourse는 잘 작동합니다. 혹시 아이디어가 있으신가요?
bartv
(Bart )
10월 25, 2023, 5:52오전
2
혹시 있나요? Canned Replies가 고장 나서 우리도 이 기능을 사용할 수 없어요. 좀 난감한 상황이에요..
솔직히 이 문제에 대해 좀 막막합니다. 템플릿이 15개보다 훨씬 더 많고, 템플릿 목록도 정상적으로 로드됩니다.
혹시 템플릿 중 특별한 것이 있나요? 모두 비공개로 설정한 뒤 하나씩 다시 공개하여 문제가 드러나는지 확인해 볼 수 있을까요? (비공개 설정은 활성 목록에서 해당 템플릿을 제거합니다)
bartv
(Bart )
10월 25, 2023, 6:28오전
4
아, 뭔가 핵심을 짚은 것 같네요! 내 템플릿이 들어 있는 카테고리에만 접근해도 로딩이 매우 느리거나 크래시가 발생합니다 모든 주제를 비공개로 설정하고 템플릿 플러그인을 비활성화했지만, 문제는 여전히 남아 있습니다.
음. 'Template’이라는 이름 때문에 어떤 플러그인끼리 충돌이 일어나고 있을 수 있을까요? 안전 모드에서 해당 카테고리의 느린 로딩 문제가 여전히 지속되나요?
bartv
(Bart )
10월 25, 2023, 6:33오전
6
네, 방금 테스트를 해보고 있었어요. 안전 모드에서도 같은 문제가 발생하네요. 새 카테고리를 만들어서 일부 템플릿을 옮겨보고 그게 문제를 해결하는지 확인해볼게요.
bartv
(Bart )
10월 25, 2023, 6:40오전
7
그렇게 하니 해결됐어요! 올바른 방향으로 이끌어 주셔서 감사합니다
Jagster
(Jakke Flemming)
10월 25, 2023, 8:04오전
8
무엇이 문제였는지 공유해 주시겠습니까? 비슷한 문제에 직면한 다른 분들이 도움이 될 수 있도록요.
bartv
(Bart )
10월 25, 2023, 8:45오전
9
시간을 들여 조사하지 않고 그냥 구식 카테고리를 삭제했습니다.
이 문제의 원인을 찾은 것 같습니다. 앞으로의 여행자들을 위해, 이 PR이 병합될 때 수정되어야 할 것 같습니다:
main ← fix/list-slowness
merged 07:31PM - 31 Jan 24 UTC
Some communities were noticing that fetching the list of templates was very slow… .
This issue wouldn't just affect the templates form, but also browsing the templates category and
Most of the communities didn't look like they were affected but in some with extreme cases, this was causing 502 errors.
The problem also seemed intermittent, with the slowness going away completely without any special action.
Upon inspecting a particularly affected instance, the problem was narrowed down to the list of subcategories from the categories templates that was repeating the same `id` multiple times.
The issue was tracked to a line that was mutating an array returned by the method `Category.subcategory_ids` and prepending an item. Unfortunately, the result of this method was cached in the `DistributedCache` and mutating the array was causing the cached value to pile up the same category `id` in the array.
This caused the database queries that used the value returned for this function to become slow over time when the argument was the templates category. The busier the Community, the worst the problem would get.
This commit removes the `prepend` that was causing the issue.