- 
                Notifications
    You must be signed in to change notification settings 
- Fork 49
INTERNAL: Retry authentication on failure without reconnecting #976
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
Conversation
| @oliviarla @brido4125 | 
| priorStatus = null; | ||
| foundStatus.set(null); | ||
|  | ||
| initSaslClient(); | 
There was a problem hiding this comment.
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 κ°μ²΄ μ체μ λν μ΄ν΄λκ° μλ μνμμ κ³ λ €ν΄μ£ΌμΈμ)
There was a problem hiding this comment.
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ν κ°μ λ°μ§ μμμΌλ―λ‘ λ€μ κ° κ³μ°μ΄ λΆκ°λ₯νκΈ° λλ¬Έμ
λλ€.
There was a problem hiding this comment.
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λ₯Ό μ κ±°νλ λμμ μννκ³  μκΈ΄ ν©λλ€.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dispose() λ©μλμ μν μ μλ©Έμμ μν μ λ κ°κΉμ΅λλ€.
λ μ΄μ SaslClient κ°μ²΄λ₯Ό μ¬μ©νμ§ μμ λμ νΈμΆνλ μ©λμ λ κ°κΉμ΅λλ€.
There was a problem hiding this 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 λ±μ μν©μλ κΈ°μ‘΄λ‘μ§μ²λΌ
μ°κ²° ν΄μ  ν, μ¬μ°κ²°νλλ‘ ν΄μΌν κ² κ°μμ
| Timeoutμ κΈ°μ‘΄μ latch.await()μ νμμμ κ°μ μ£Όκ³  μμ§ μμμ, νμ¬λ κ±Έλ¬λΌ μ μμ΅λλ€. κ·Έ μΈμ μλ¬λ€μ IO Threadμ handleIO() λ‘μ§ λ΄μμ μμμ μ°κ²°μ΄ ν΄μ λκΈ° λλ¬Έμ AuthThreadμμ λ°λ‘ 무μΈκ° ν΄μ€ κ²μ΄ μμ΅λλ€. | 
| + node.getSocketAddress() + ": " + priorStatus.getMessage()); | ||
| break; | ||
|  | ||
| priorStatus = null; | 
There was a problem hiding this comment.
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 μμ²μ 보λ΄κ² λλμ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
κ·Έλ¦¬κ³ , μ΄λ€ priorStatus μΈ κ²½μ°μ μ¬μννκ² λλμ?
There was a problem hiding this comment.
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 κ³Όμ μ μ²μλΆν° μ¬μλν©λλ€.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
νμ¬ busy νκ² μ¬μννλ λ°, μΌμ  μκ° λκΈ°νμ μ¬μνν΄μΌ νμ§ μλκ°μ?
그리고 κ·Έ λμμ λ€μ΄μ€λ μμ²λ€μ λν μ²λ¦¬λ μμ΄μΌ ν  κ² κ°μ΅λλ€.
There was a problem hiding this comment.
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μ΄μ ν λ²μ© μννκ² λ©λλ€.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
κ°λ
μ μΌλ‘λ μ°κ²°μ λμ νμκ° μλ€λ κ²μΈλ°μ.
1μ΄κ° μμ²μ λ³΄λΌ μ μλ μνμ΄λ―λ‘,
ꡬνμ νΈμμ± κ΄μ μμλ μ°κ²°μ λκ³  1μ΄ νμ μ¬μ°κ²°μ μλνκ² κ΅¬ννμ¬λ λ  κ² κ°μ΅λλ€.
μ΄λ€ ꡬνμ΄ λμκ°μ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auth κ΄λ ¨ μμ μ νλμ commitμΌλ‘ 보λ κ²μ΄ μ’μ μ μκ² λ€λ μκ°μ΄ λλλ€.
There was a problem hiding this comment.
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 μλ΅μ λ°μμ λμ λμ : ...
There was a problem hiding this comment.
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 μ°μ°μ λν΄ μ μκ³  μμΌλ―λ‘,
μμ κ²½μ°μ μ΄λ»κ² μ²λ¦¬ν΄μΌ νλ μ§λ₯Ό μ€μ€λ‘ μ λ¦¬ν  μ μμ κ²μ
λλ€.
μ΄μμ μ λ¦¬ν΄ μ£Όμμ£ .
There was a problem hiding this comment.
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 μλ΅μ΄ μ€λ©΄ μ¦μ μ¬μννλ κ²μ΄ λ§μ΅λλ€.
μμ κ°μ μ½λ©νΈλ€ λλ¬Έμ μ΄λ€ λμμ μνμλ κ²μΈμ§ μλΉν ν·κ°λ¦¬λ μνμ
λλ€.
λνλμ΄ μνμλ λμμ΄ μμν
λ, μ΄λ₯Ό μλ €λ¬λΌλ κ²μ
λλ€.
μ κ° μκ°νλ λμμ μλ €λ리λ κ²μ μ½κ² μνν  μ μλ μμ
μ΄μ§λ§, λνλμ΄ μνμλ λμμ΄ λ¬΄μμΈμ§ μ΄ν΄ν  μ μμΌλ λ€μ μ λ¦¬ν΄μ£Όμ
¨μΌλ©΄ μ’κ² μ΅λλ€.
π Related Issue
β¨οΈ What I did