Skip to content

Conversation

@uhm0311
Copy link
Collaborator

@uhm0311 uhm0311 commented Sep 29, 2025

πŸ”— Related Issue

⌨️ What I did

  • authκ°€ μ‹€νŒ¨ν–ˆμ„ λ•Œ, μž¬μ—°κ²°μ„ ν•˜μ§€ μ•Šκ³  authλ₯Ό μž¬μ‹œλ„ν•©λ‹ˆλ‹€.
  • SaslClient 객체 λ‚΄λΆ€μ˜ μƒνƒœλ₯Ό μ΄ˆκΈ°ν™”ν•˜κΈ° μœ„ν•΄, authκ°€ μ‹€νŒ¨ν•˜λ©΄ SaslClient 객체λ₯Ό μƒˆλ‘œ μƒμ„±ν•©λ‹ˆλ‹€.
  • 후속 PR둜 NOT_SUPPORTED 처리λ₯Ό λ°˜μ˜ν•  μ˜ˆμ •μž…λ‹ˆλ‹€.

@uhm0311 uhm0311 requested a review from jhpark816 September 29, 2025 09:20
@jhpark816 jhpark816 requested review from brido4125 and oliviarla and removed request for jhpark816 September 30, 2025 08:56
@jhpark816
Copy link
Collaborator

@oliviarla @brido4125
μ •ν™•ν•œ 리뷰가 ν•„μš”ν•©λ‹ˆλ‹€.

priorStatus = null;
foundStatus.set(null);

initSaslClient();
Copy link
Collaborator

@brido4125 brido4125 Sep 30, 2025

Choose a reason for hiding this comment

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

연결에 μ‹€νŒ¨ν•  λ•Œ λ§ˆλ‹€, 맀번 Sasl Client 객체λ₯Ό μƒˆλ‘­κ²Œ 생성해 μ€˜μ•Όν•˜λ‚˜μš”?
연결이 μ‹€νŒ¨ν•œ 경우, latchλ₯Ό 톡해 buildOperation으둜 μƒμ„±λœ sasl operation만 μƒˆλ‘­κ²Œ 보내보고
κ·Έ κ²°κ³Όλ₯Ό 톡해 μ—°κ²°μ˜ 성곡/μ‹€νŒ¨ μ—¬λΆ€λ§Œ νŒλ‹¨ν•˜λ©΄ μ•ˆλ˜λ‚˜μš”?
(ν˜„μž¬ jdk λ‹¨μ˜ SaslClient 객체 μžμ²΄μ— λŒ€ν•œ 이해도가 μ—†λŠ” μƒνƒœμž„μ„ κ³ λ €ν•΄μ£Όμ„Έμš”)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

SaslClient λ‚΄λΆ€ μƒνƒœκ°€ λͺ‡ λ‹¨κ³„λ‘œ λ‚˜λ‰˜μ–΄μ Έ μžˆλŠ”λ°, κ·Έ 단계가 졜초 μƒνƒœλ‘œ λŒμ•„κ°€μ§€ μ•ŠμœΌλ©΄ μž¬μ‹œλ„κ°€ λΆˆκ°€λŠ₯ν•©λ‹ˆλ‹€.
μ΄λŠ” μ„œλ²„μ™€ ν΄λΌμ΄μ–ΈνŠΈκ°€ μ„œλ‘œ μ£Όκ³  λ°›λŠ” 값듀을 기반으둜 μƒˆλ‘œμš΄ 값을 계산해야 ν•˜λŠ”λ°, AUTH_ERROR 응닡을 λ°›λŠ” 경우 SCRAM-256 μ•Œκ³ λ¦¬μ¦˜ μž…μž₯μ—μ„œ Validν•œ 값을 λ°›μ§€ μ•Šμ•˜μœΌλ―€λ‘œ λ‹€μŒ κ°’ 계산이 λΆˆκ°€λŠ₯ν•˜κΈ° λ•Œλ¬Έμž…λ‹ˆλ‹€.

Copy link
Collaborator

Choose a reason for hiding this comment

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

SaslClient#dispose λ©”μ„œλ“œμ—μ„œ stateλ₯Ό SEND_CLIENT_FIRST_MESSAGE둜 μ΄ˆκΈ°ν™”ν•˜λŠ” 방법은 μ–΄λ–€κ°€μš”?

dispose λ©”μ„œλ“œμ˜ 주석에 Invoking this method invalidates the SaslClient instance. This method is idempotent. 라고 μ“°μ—¬μžˆκ³  일반적으둜 passwordλ₯Ό μ œκ±°ν•˜λŠ” λ™μž‘μ„ μˆ˜ν–‰ν•˜κ³  있긴 ν•©λ‹ˆλ‹€.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

dispose() λ©”μ†Œλ“œμ˜ 역할은 μ†Œλ©Έμžμ˜ 역할에 더 κ°€κΉμŠ΅λ‹ˆλ‹€.
더 이상 SaslClient 객체λ₯Ό μ‚¬μš©ν•˜μ§€ μ•Šμ„ λ•Œμ— ν˜ΈμΆœν•˜λŠ” μš©λ„μ— 더 κ°€κΉμŠ΅λ‹ˆλ‹€.

Copy link
Collaborator

@brido4125 brido4125 left a comment

Choose a reason for hiding this comment

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

μ—°κ΄€ μ΄μŠˆμ— 보면 μ•„λž˜ λ‚΄μš©μ΄ μžˆλŠ”λ°μš”,

AuthThread λ‚΄μ—μ„œ AUTH_ERROR 응닡을 받은 경우, TCP 연결을 ν•΄μ œν•˜μ§€ μ•Šκ³  authλ₯Ό μž¬μ‹œλ„ν•œλ‹€. κ·Έ μ™Έμ˜ μ˜ˆμ™Έ 상황(Timeout, inactive node, ERROR 응닡 μˆ˜μ‹  λ“±)μ—μ„œλŠ” TCP 연결을 ν•΄μ œν•œ ν›„ λ‹€μ‹œ 연결을 ν•˜λ„λ‘ ν•œλ‹€.

ν˜„μž¬ κ΅¬ν˜„μ€ "SASL_OK"κ°€ μ•„λ‹Œ λͺ¨λ“  κ²½μš°μ—
μž¬μ—°κ²° ν•˜μ§€ μ•Šκ³  authλ₯Ό μž¬μ‹œλ„ ν•˜κ³  μžˆλŠ” κ΅¬ν˜„μ΄μ§€ μ•Šλ‚˜μš”?

Timeout, inactive node, ERROR λ“±μ˜ μƒν™©μ—λŠ” 기쑴둜직처럼
μ—°κ²° ν•΄μ œ ν›„, μž¬μ—°κ²°ν•˜λ„λ‘ 해야할것 κ°™μ•„μš”

@uhm0311
Copy link
Collaborator Author

uhm0311 commented Oct 1, 2025

@brido4125

Timeout은 기쑴에 latch.await()에 νƒ€μž„μ•„μ›ƒ 값을 μ£Όκ³  μžˆμ§€ μ•Šμ•„μ„œ, ν˜„μž¬λŠ” κ±ΈλŸ¬λ‚Ό 수 μ—†μŠ΅λ‹ˆλ‹€.
νƒ€μž„μ•„μ›ƒ 값을 μ£Όκ³  Timeout 처리λ₯Ό ν•˜λŠ” 것은 λ‹€μŒ PR둜 λ°˜μ˜ν•˜κ² μŠ΅λ‹ˆλ‹€.

κ·Έ μ™Έμ˜ μ—λŸ¬λ“€μ€ IO Thread의 handleIO() 둜직 λ‚΄μ—μ„œ μ•Œμ•„μ„œ 연결이 ν•΄μ œλ˜κΈ° λ•Œλ¬Έμ— AuthThreadμ—μ„œ λ”°λ‘œ 무언가 해쀄 것이 μ—†μŠ΅λ‹ˆλ‹€.

@uhm0311 uhm0311 requested a review from brido4125 October 1, 2025 02:50
@uhm0311 uhm0311 requested a review from jhpark816 October 1, 2025 04:14
+ node.getSocketAddress() + ": " + priorStatus.getMessage());
break;

priorStatus = null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@uhm0311
λ³Έ PR 의미λ₯Ό μ΄ν•΄ν•˜κΈ° μœ„ν•΄ μ§ˆλ¬Έν•©λ‹ˆλ‹€.
μ–΄λ–€ priorStatus 일 κ²½μš°μ— buildOperation() λ‹€μ‹œ μˆ˜ν–‰ν•˜μ—¬ auth μš”μ²­μ„ λ³΄λ‚΄κ²Œ λ˜λ‚˜μš”?

Copy link
Collaborator

Choose a reason for hiding this comment

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

그리고, μ–΄λ–€ priorStatus 인 κ²½μš°μ— μž¬μˆ˜ν–‰ν•˜κ²Œ λ˜λ‚˜μš”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

SASL_CONTINUE 응닡을 받은 경우 buildOperation()을 λ‹€μ‹œ μˆ˜ν–‰ν•˜κ³  λ‹€μŒ auth 과정을 μ§„ν–‰ν•©λ‹ˆλ‹€.
AUTH_ERROR 응닡을 받은 κ²½μš°μ—λŠ” auth 과정을 μ²˜μŒλΆ€ν„° μž¬μ‹œλ„ν•©λ‹ˆλ‹€.

Copy link
Collaborator

@jhpark816 jhpark816 Oct 1, 2025

Choose a reason for hiding this comment

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

ν˜„μž¬ busy ν•˜κ²Œ μž¬μˆ˜ν–‰ν•˜λŠ” 데, 일정 μ‹œκ°„ λŒ€κΈ°ν›„μ— μž¬μˆ˜ν–‰ν•΄μ•Ό ν•˜μ§€ μ•ŠλŠ”κ°€μš”?
그리고 κ·Έ λ™μ•ˆμ— λ“€μ–΄μ˜€λŠ” μš”μ²­λ“€μ— λŒ€ν•œ μ²˜λ¦¬λ„ μžˆμ–΄μ•Ό ν•  것 κ°™μŠ΅λ‹ˆλ‹€.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

latch.await() 후에 Thread.sleep(100)이 있기 λ•Œλ¬Έμ— 0.1μ΄ˆμ— ν•œ λ²ˆμ”© μˆ˜ν–‰ν•˜κ²Œ λ©λ‹ˆλ‹€.

Copy link
Collaborator

Choose a reason for hiding this comment

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

κ°œλ…μ μœΌλ‘œλŠ” 연결을 λŠμ„ ν•„μš”κ°€ μ—†λ‹€λŠ” κ²ƒμΈλ°μš”.
1μ΄ˆκ°„ μš”μ²­μ„ 보낼 수 μ—†λŠ” μƒνƒœμ΄λ―€λ‘œ,
κ΅¬ν˜„μ˜ νŽΈμ˜μ„± κ΄€μ μ—μ„œλŠ” 연결을 끊고 1초 후에 μž¬μ—°κ²°μ„ μ‹œλ„ν•˜κ²Œ κ΅¬ν˜„ν•˜μ—¬λ„ 될 것 κ°™μŠ΅λ‹ˆλ‹€.
μ–΄λ–€ κ΅¬ν˜„μ΄ λ‚˜μ€κ°€μš”?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Auth κ΄€λ ¨ μˆ˜μ •μ„ ν•˜λ‚˜μ˜ commit으둜 λ³΄λŠ” 것이 쒋을 수 μžˆκ² λ‹€λŠ” 생각이 λ“­λ‹ˆλ‹€.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

μ•„λž˜μ™€ 같이 μ •λ¦¬ν•΄μ£Όμ‹œκΈΈ λ°”λžλ‹ˆλ‹€.

  • AUTH_ERROR 응닡을 λ°›μ•˜μ„ λ–„μ˜ λ™μž‘ : ...
  • CLIENT_ERROR, SERVER_ERROR, ERROR 응닡을 λ°›μ•˜μ„ λ•Œμ˜ λ™μž‘ : ...

Copy link
Collaborator

Choose a reason for hiding this comment

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

μ•„λž˜μ™€ 같이 μ •λ¦¬ν•΄μ£Όμ‹œκΈΈ λ°”λžλ‹ˆλ‹€.

  • AUTH_ERROR 응닡을 λ°›μ•˜μ„ λ–„μ˜ λ™μž‘ : ...
  • CLIENT_ERROR, SERVER_ERROR, ERROR 응닡을 λ°›μ•˜μ„ λ•Œμ˜ λ™μž‘ : ...

Clientμ—μ„œμ˜ auth 연산에 λŒ€ν•΄ 잘 μ•Œκ³  μžˆμœΌλ―€λ‘œ,
μœ„μ˜ κ²½μš°μ— μ–΄λ–»κ²Œ μ²˜λ¦¬ν•΄μ•Ό ν•˜λŠ” μ§€λ₯Ό 슀슀둜 정리할 수 μžˆμ„ κ²ƒμž…λ‹ˆλ‹€.
μ΄μŠˆμ— 정리해 μ£Όμ‹œμ£ .

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

auth μš”μ²­μ—μ„œ ERROR 응닡을 받을 경우, delayed reconnect μ²˜λ¦¬ν•˜λ©΄ μ’‹κ² μŠ΅λ‹ˆλ‹€.
auth μš”μ²­μ΄ μ‹€νŒ¨ν•œ μƒνƒœμ—μ„œ reconnect ν•˜κΈ° μ „μ˜ μƒνƒœμ—μ„œ λ“€μ–΄μ˜€λŠ” λͺ¨λ“  μš”μ²­μ€ "authentication timeout"κ°€ μ•„λ‹Œ "authentication failed"둜 cancelν•˜λ©΄ μ’‹κ² μŠ΅λ‹ˆλ‹€.
μž¬μ—°κ²°ν•˜μ—¬ auth μš”μ²­μ„ λ³΄λ‚΄λŠ” κ²½μš°μ—, λ‹€λ₯Έ μš”μ²­λ“€μ€ λŒ€κΈ°μ‹œν‚€κ³ , authentication timeout으둜 μΊ”μŠ¬ν•˜λ©΄ λ©λ‹ˆλ‹€.
auth μ‹€νŒ¨κ°€ λͺ…ν™•ν•œ κ²½μš°λŠ” 항상 1μ΄ˆκ°€ λŒ€κΈ°ν•˜κ²Œ λ§Œλ“€μ§€ μ•Šκ³  "authentication failed"둜 cancelν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

auth μš”μ²­ μ‹œμ— ERROR 응닡이 와도 1초 λŒ€κΈ°κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

μ•žμ„œ 잘λͺ» νŒλ‹¨ν–ˆμŠ΅λ‹ˆλ‹€.
ERROR 응닡이 였면 μ¦‰μ‹œ μž¬μˆ˜ν–‰ν•˜λŠ” 것이 λ§žμŠ΅λ‹ˆλ‹€.

μœ„μ™€ 같은 μ½”λ©˜νŠΈλ“€ λ•Œλ¬Έμ— μ–΄λ–€ λ™μž‘μ„ μ›ν•˜μ‹œλŠ” 것인지 μƒλ‹Ήνžˆ ν—·κ°ˆλ¦¬λŠ” μƒνƒœμž…λ‹ˆλ‹€.
λŒ€ν‘œλ‹˜μ΄ μ›ν•˜μ‹œλŠ” λ™μž‘μ΄ μžˆμ„ν…Œλ‹ˆ, 이λ₯Ό μ•Œλ €λ‹¬λΌλŠ” κ²ƒμž…λ‹ˆλ‹€.
μ œκ°€ μƒκ°ν•˜λŠ” λ™μž‘μ„ μ•Œλ €λ“œλ¦¬λŠ” 것은 μ‰½κ²Œ μˆ˜ν–‰ν•  수 μžˆλŠ” μž‘μ—…μ΄μ§€λ§Œ, λŒ€ν‘œλ‹˜μ΄ μ›ν•˜μ‹œλŠ” λ™μž‘μ΄ 무엇인지 이해할 수 μ—†μœΌλ‹ˆ λ‹€μ‹œ μ •λ¦¬ν•΄μ£Όμ…¨μœΌλ©΄ μ’‹κ² μŠ΅λ‹ˆλ‹€.

@uhm0311 uhm0311 closed this Oct 28, 2025
@uhm0311 uhm0311 deleted the uhm0311/f/1 branch October 28, 2025 07:00
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