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

INTERNAL: read while END/PIPE_ERROR received in the pipe operation #839

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

oliviarla
Copy link
Collaborator

@oliviarla oliviarla commented Nov 15, 2024

๐Ÿ”— Related Issue

โŒจ๏ธ What I did

  • ๋ณธ PR์—์„œ๋Š” ๋‘ ๊ฐ€์ง€ ์‚ฌํ•ญ์„ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
    • proxy ์„œ๋ฒ„์—์„œ ํ•˜๋‚˜์˜ pipe operation์—์„œ ์—ฌ๋Ÿฌ error๊ฐ€ ๋ฐœ์ƒํ•  ๋•Œ๋ฅผ ๋Œ€๋น„ํ•˜์—ฌ operation์˜ ์˜ˆ์™ธ ํ•„๋“œ๋ฅผ List๋กœ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.
    • pipe operation์—์„œ ์˜ˆ์™ธ๊ฐ€ ํ•˜๋‚˜๋ผ๋„ ๋ฐœ์ƒํ–ˆ์„ ๋•Œ ๊ณง๋ฐ”๋กœ ์ปค๋„ฅ์…˜์„ ๋Š๋Š” ๋Œ€์‹  END|PIPE_ERROR ๊นŒ์ง€ ์ฝ๊ณ  ์˜ˆ์™ธ๋ฅผ ๋ชจ์•„ ์ €์žฅํ•ด๋‘ก๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ์‚ฌ์šฉ์ž๋Š” get() ๋ฉ”์„œ๋“œ ํ˜ธ์ถœ ์‹œ ๋ฐœ์ƒํ–ˆ๋˜ ๋ชจ๋“  ์˜ˆ์™ธ๋ฅผ CompositeException์„ ํ†ตํ•ด ์กฐํšŒํ•ด๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ๋งŒ์•ฝ ๋ชจ๋“  response๋ฅผ ์ฝ์€ ํ›„์— END|PIPE_ERROR ๋ฅผ ์ฝ์ง€ ๋ชปํ–ˆ๋‹ค๋ฉด ๋ฒ„ํผ๋กœ๋ถ€ํ„ฐ ๋‹ค์Œ Line์„ ์ฝ๋Š” ์‹œ์ ์— OperationException์„ ๋˜์ ธ ์ปค๋„ฅ์…˜์„ ๋Š๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

@jhpark816 jhpark816 removed their request for review November 15, 2024 11:17
@jhpark816
Copy link
Collaborator

@uhm0311 ๋จผ์ € ๋ฆฌ๋ทฐํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

Copy link
Collaborator

@uhm0311 uhm0311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1์ฐจ ์งˆ๋ฌธ์ž…๋‹ˆ๋‹ค.

Copy link
Collaborator

@uhm0311 uhm0311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2์ฐจ, ๋ฆฌ๋ทฐ ์˜๊ฒฌ๊ณผ ์งˆ๋ฌธ์ž…๋‹ˆ๋‹ค.

@oliviarla oliviarla force-pushed the pipeend branch 2 times, most recently from faec8fa to 20cf3d9 Compare November 19, 2024 06:48
@oliviarla oliviarla self-assigned this Nov 19, 2024
Copy link
Collaborator

@uhm0311 uhm0311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3์ฐจ ๋ฆฌ๋ทฐ ์˜๊ฒฌ์ž…๋‹ˆ๋‹ค.

@jhpark816
Copy link
Collaborator

@oliviarla @uhm0311
CompositeException์˜ printCallStack() ๊ด€๋ จ PR์€ merge ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

@oliviarla oliviarla force-pushed the pipeend branch 2 times, most recently from 5493230 to 466ff60 Compare November 26, 2024 10:28
@oliviarla
Copy link
Collaborator Author

@uhm0311 @jhpark816
ํ˜„์žฌ END/PIPE_ERROR๊ฐ€ ์˜ค์ง€ ์•Š์•„ ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ๋กœ๊น…์ด ๋˜๋Š”๋ฐ์š”, ์ด ๋•Œ ์–ด๋–ค ์—๋Ÿฌ๊ฐ€ ์–ด๋–ค ์—ฐ์‚ฐ์—์„œ ๋‚ฌ๋Š”์ง€ ํ™•์ธํ•˜๊ธฐ ์–ด๋ ต๋‹ค๋Š” ๋‹จ์ ์ด ์žˆ๊ธด ํ•ฉ๋‹ˆ๋‹ค๋งŒ, ๋ณ„๋‹ค๋ฅธ ํ•ด๊ฒฐ ๋ฐฉ์•ˆ์€ ์—†๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. (pipe operation์—์„œ ๋‚ด๋ถ€์ ์œผ๋กœ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” index ์ •๋ณด๋ฅผ ๊ฐ™์ด ๋กœ๊น…ํ•˜๋ฉด ์–ด๋–จ๊นŒ ์ƒ๊ฐํ•ด๋ณด์•˜๋Š”๋ฐ, ๋ฉ”์„œ๋“œ ์ธ์ž ๋“ฑ์„ ๋กœ๊ทธ๋กœ ์•Œ๊ธฐ ์–ด๋ ค์šฐ๋ฏ€๋กœ index๋ฅผ ์•Œ๋”๋ผ๋„ ์“ธ๋ชจ์—†๋Š” ์ •๋ณด๊ฐ€ ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.)

OperationException: SERVER: Multiple exceptions (3) reported: SERVER_ERROR out of memory @ testnode 0.0.0.0/0.0.0.0:11211, CLIENT_ERROR too large value @ testnode 0.0.0.0/0.0.0.0:11211, END|PIPE_ERROR not received

@oliviarla oliviarla force-pushed the pipeend branch 2 times, most recently from 00d28cd to 63fac49 Compare November 26, 2024 10:53
@oliviarla oliviarla requested a review from uhm0311 November 28, 2024 01:30
Copy link
Collaborator

@uhm0311 uhm0311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4์ฐจ ๋ฆฌ๋ทฐ ์˜๊ฒฌ์ž…๋‹ˆ๋‹ค.

@oliviarla oliviarla requested a review from jhpark816 November 28, 2024 08:23
@oliviarla
Copy link
Collaborator Author

@jhpark816 ๋ฆฌ๋ทฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

@jhpark816
Copy link
Collaborator

@oliviarla ๋ฆฌ๋ทฐ ์ง„ํ–‰ ์ค‘์ž…๋‹ˆ๋‹ค.

Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ผ๋ถ€ ๋ฆฌ๋ทฐ

Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ฆฌ๋ทฐ ์™„๋ฃŒ,
๋ณต์žกํ•œ ์ด์Šˆ๋„ค์š”.

@oliviarla
Copy link
Collaborator Author

oliviarla commented Dec 9, 2024

@jhpark816 @uhm0311
ํ˜„์žฌ ์ƒํ™ฉ์—์„œ ์ˆ˜์ •ํ•  ๋ถ€๋ถ„์„ ๋Œ€๋žต ์ •๋ฆฌํ•ด๋ดค์Šต๋‹ˆ๋‹ค. ์ฝ”๋“œ๋กœ ์ž‘์„ฑํ•˜๊ธฐ ์ „์— ๊ฒ€ํ†  ๋จผ์ € ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

  • OperationImpl#readFromBuffer์˜ ๋กœ์ง ๋ณ€๊ฒฝ
    • isPipeOperation()๊ฐ€ true์ด๊ณ  ์ฒซ ๋ฒˆ์งธ ์‘๋‹ต์ด RESPONSE <count> ๋ผ๋ฉด, ์ดํ›„์—๋Š” classifyError()๋ฅผ ๊ฑฐ์น˜์ง€ ์•Š๊ณ  handleLine()์—์„œ
    • CLIENT_ERROR, SERVER_ERROR, ERROR๋ฅผ ์ฝ๊ณ  gotStatus ์ฝœ๋ฐฑ ๋ฉ”์„œ๋“œ์— ๋„˜๊ธด๋‹ค.
  • handleLine(String line)์˜ ๋กœ์ง ๋ณ€๊ฒฝ
    • END๊ฐ€ ์™”์„ ๋•Œ์—๋Š” Operation COMPLETE ์ƒํƒœ๋กœ ๋ณ€๊ฒฝ
    • PIPE_ERROR๊ฐ€ ์™”์„ ๋•Œ์—๋Š” Operation COMPLETE ์ƒํƒœ๋กœ ๋ณ€๊ฒฝํ•˜๊ณ , operation์— ์˜ˆ์™ธ๋ฅผ ์ถ”๊ฐ€ํ•ด reconnect๋˜๋„๋ก ํ•˜๊ณ , hasErrored๊ฐ€ true๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋„๋ก ํ•œ๋‹ค.
  • getFailedResult() ๋ฉ”์„œ๋“œ๋ฅผ pipe ๊ด€๋ จ Future์— ์ถ”๊ฐ€
    • ์—๋Ÿฌ์™€ ์ƒ๊ด€์—†์ด failedResult ๊ฒฐ๊ณผ๋ฅผ ์กฐํšŒํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•œ๋‹ค.

@jhpark816
Copy link
Collaborator

@oliviarla

isPipeOperation()๊ฐ€ true์ด๋ฉด classifyError()๋ฅผ ๊ฑฐ์น˜์ง€ ์•Š๊ณ  handleLine()์—์„œ CLIENT_ERROR, SERVER_ERROR, ERROR๋ฅผ gotStatus ์ฝœ๋ฐฑ ๋ฉ”์„œ๋“œ์— ๋„˜๊ธด๋‹ค.

  • pipe ์š”์ฒญ์— ๋Œ€ํ•ด ERROR ๋“ฑ์ด ๋ฐ”๋กœ ๋‚˜์˜ฌ ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ด ๊ฒฝ์šฐ๋Š” classifyError()๋ฅผ ์ˆ˜ํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
  • pipe ์š”์ฒญ์— ๋Œ€ํ•ด RESPONSE <count>\r\n ์‘๋‹ต์ด ์˜จ ์ดํ›„์—๋Š” classifyError()๋ฅผ ๊ฑฐ์น˜์ง€ ์•Š์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค.

END๊ฐ€ ์˜ค๋ฉด ๋ฆฌ๋‹ค์ด๋ ‰ํŠธํ•œ ํ›„ Operation COMPLETE ์ƒํƒœ๋กœ ๋ณ€๊ฒฝ
PIPE_ERROR๊ฐ€ ์˜ค๋ฉด ๋ฆฌ๋‹ค์ด๋ ‰ํŠธํ•œ ํ›„ Operation COMPLETE ์ƒํƒœ๋กœ ๋ณ€๊ฒฝ

๋ฆฌ๋‹ค์ด๋ ‰ํŠธํ•œ๋‹ค๋Š” ๊ฒƒ์ด ์–ด๋–ค ์˜๋ฏธ์ธ๊ฐ€์š”?

future.get()์˜ ๋กœ์ง ๋ณ€๊ฒฝ
hasErrored ์ผ ๋•Œ์—๋Š” exception์„ ๋˜์ง€์ง€ ์•Š๋Š”๋‹ค.

result๊ฐ€ ์žˆ๋Š” ์ง€์— ๋”ฐ๋ผ ํŒ๋‹จํ•ด์•ผ ํ•  ์ง€ ? ์ •๋„์˜ ๋Š๋‚Œ์ด ๋“ญ๋‹ˆ๋‹ค.

@oliviarla
Copy link
Collaborator Author

@jhpark816
์œ— ์ฝ”๋ฉ˜ํŠธ๋ฅผ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.

@jhpark816
Copy link
Collaborator

jhpark816 commented Dec 9, 2024

hasErrored๋กœ ์ธํ•œ exception์€ ๋˜์ง€์ง€ ์•Š๋Š”๋‹ค. cancel์— ๋Œ€ํ•œ exception์€ ๋˜์ง„๋‹ค. (์ด ๋•Œ์—๋Š” ์–ด๋””๊นŒ์ง€ ์ฒ˜๋ฆฌ๋˜์—ˆ๋Š”์ง€ ์—ฌ๋ถ€๋Š” ์•Œ ์ˆ˜ ์—†๋‹ค.)

  • exception, cancel, timeout ๊ด€๋ จ ์ฒ˜๋ฆฌ๋Š” ๋™์ผํ•ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
  • future.get() ๋™์ž‘์„ ์•„๋ž˜์™€ ๊ฐ™์ด ์ˆ˜์ •ํ•˜๋Š” ๋ฐฉ์•ˆ์ด ์žˆ์Šต๋‹ˆ๋‹ค. (backward compatibility ์ด์Šˆ ๋ฐœ์ƒ)
    • error, cancel, timeout ์‹œ์— exception throw ํ•˜์ง€ ์•Š๋Š” ๋ฐฉ์‹์ด ์žˆ์Šต๋‹ˆ๋‹ค.
    • ์ด ๊ฒฝ์šฐ, error, cacncel, timeout์„ OperationStatus๋กœ ๋ฆฌํ„ดํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
  • future.get() ๋™์ž‘์„ ๊ทธ๋Œ€๋กœ ์œ ์ง€ํ•˜๋Š” ๋Œ€์‹ , getSome() ๊ฐ™์€ ๋ณ„๋„์˜ ๋ฉ”์†Œ๋“œ๋ฅผ ๋‘๋Š” ๋ฐฉ์‹์ด ์žˆ์Šต๋‹ˆ๋‹ค.
    • getSome()์€ error, cacncel, timeout์„ OperationStatus๋กœ ๋ฆฌํ„ดํ•ฉ๋‹ˆ๋‹ค.
    • getSome()์€ getBulk์—์„œ ์ œ๊ณตํ•˜๋Š” ๋ฉ”์†Œ๋“œ์ด๊ณ , storeBulk์— ๋งž๋Š” ์šฉ์–ด์˜ ๋ฉ”์†Œ๋“œ(getFailed())์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

@uhm0311
Copy link
Collaborator

uhm0311 commented Dec 10, 2024

END๊ฐ€ ์™”์„ ๋•Œ์—๋Š” Operation COMPLETE ์ƒํƒœ๋กœ ๋ณ€๊ฒฝ

ํ˜„์žฌ์™€ ๋™์ผํ•œ ๋™์ž‘์ด๋ž€ ๊ฑฐ์ฃ ?

getFailedResult() ๋ฉ”์„œ๋“œ๋ฅผ pipe ๊ด€๋ จ Future์— ์ถ”๊ฐ€

ํ•ด๋‹น ๋ฉ”์†Œ๋“œ์˜ ๋ฆฌํ„ด ํƒ€์ž…์€ ์–ด๋–ป๊ฒŒ ๋˜๋‚˜์š”?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants