meglio
(Anton)
11월 3, 2021, 9:43오전
1
ArgumentError (Attributes per element limit exceeded) - when clicking on the “edit” icon to see topic version diffs.
Developer Console
Logs
Message (2 copies reported)
ArgumentError (Attributes per element limit exceeded)
lib/discourse_diff.rb:171:in `tokenize_html_blocks'
lib/discourse_diff.rb:10:in `initialize'
app/serializers/post_revision_serializer.rb:117:in `new'
app/serializers/post_revision_serializer.rb:117:in `body_changes'
(eval):18:in `_fast_attributes'
app/controllers/application_controller.rb:520:in `render_json_dump'
app/controllers/posts_controller.rb:408:in `latest_revision'
app/controllers/application_controller.rb:397:in `block in with_resolved_locale'
app/controllers/application_controller.rb:397:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:356:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/request_tracker.rb:187:in `call'
Backtrace
nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5/document_fragment.rb:38:in `fragment'
nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5/document_fragment.rb:38:in `initialize'
nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5/document_fragment.rb:52:in `new'
nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5/document_fragment.rb:52:in `parse'
nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5.rb:242:in `fragment'
lib/discourse_diff.rb:171:in `tokenize_html_blocks'
lib/discourse_diff.rb:10:in `initialize'
app/serializers/post_revision_serializer.rb:117:in `new'
app/serializers/post_revision_serializer.rb:117:in `body_changes'
(eval):18:in `_fast_attributes'
Env
HTTP HOSTS: jai.community
sam
(Sam Saffron)
11월 4, 2021, 12:32오전
2
Is this on the site we host for you? We need to see the diff that causes the pathological behavior.
meglio
(Anton)
11월 4, 2021, 12:46오전
3
It’s self-hosted. What would be the best way to share the diff with you?
sam
(Sam Saffron)
11월 4, 2021, 12:52오전
4
If there is nothing secret, can you try reproducing here? Just post a reply, then wait 10 minutes and make the problem edit.
meglio
(Anton)
11월 4, 2021, 12:57오전
5
It’s not a public community, and the material is regarding a beta product that’s not public either. So with all the respect to both the author of the material and the Discourse team, I’d prefer not to share it here. Any other simple way?
1개의 좋아요
sam
(Sam Saffron)
11월 4, 2021, 1:43오전
6
I guess divide and conquer? Try making smaller and smaller repros until you find the culprit line?
1개의 좋아요
meglio
(Anton)
11월 4, 2021, 1:51오전
7
Shell I post the content of that particular topic in a PM to you here in Meta?
sam
(Sam Saffron)
11월 4, 2021, 1:53오전
8
Feel free, especially if you can create a repro.
저도 매우 유사한(또는 관련이 있는) 문제를 경험하고 있습니다.
재현 방법 / 원인:
이 문제는 매우 긴 게시글 (약 100,000자)에서 발생합니다.
구체적으로 대규모 수정 (콘텐츠의 상당 부분이 변경될 때)에 의해 발생합니다.
이러한 방대한 편집을 저장하려고 하면 백엔드가 종종 타임아웃(502/504)에 도달합니다. 근본 원인은 구버전과 신버전 간의 Diff 계산 이라고 추정하는데, 이 두 조건이 결합되면 비용이 극도로 높아지기 때문입니다.
이 이슈는 해당 토론이 다음 링크에서 계속되고 있으므로 닫겠습니다.
매우 긴 게시글(약 10만 자)을 편집하고 저장할 때 백엔드 타임아웃 문제가 발생했습니다. 저장 작업 중 서버가 응답하지 않아 502/504 에러가 발생합니다. 프론트엔드 콘솔에는 다음과 같은 에러 스택이 표시됩니다:
ajax-error.js:36:15
l ajax-error.js:36
u ajax-error.js:75
d ajax-error.js:84
Ember 41
update rest.js:72
update rest.js:72
save rest.js:115
editPost composer.js:1147
Ember 6
몇 가지 비교 테스트를 수행해 보니 병목 현상은 이전 버전과 새 버전 간의 diff 계산에 있는 것으로 보입니다.
긴 게시글 A를 긴 게시글 B로 직접 편집하여 저장하면 일관되게 502/504 타임아웃이 발생합니다.
먼저 긴 게시글을 지우고 짧은 플레이스홀더(예: 5자)를 저장한 뒤, 새로운 전체 내용 B를 붙여넣고 저장하면 빠르게 완료됩니다.
현재 Dif…