jcmturner / gokrb5

Pure Go Kerberos library for clients and services
Apache License 2.0
723 stars 245 forks source link

add TCP dialTimeout logs #453

Closed chandanjainn closed 2 years ago

chandanjainn commented 2 years ago

For our use case we had KDC ip being assigned through an automation script.

The method here https://github.com/jcmturner/gokrb5/blob/663478bf457f1fc3275973bea5b7b787cd332015/v8/client/network.go#L150-L151 had the array errs storing all the errors thrown during tcp connection but was not using them anywhere, didn't log them nor append them to the error stack trace, but just threw a generic error here at https://github.com/jcmturner/gokrb5/blob/663478bf457f1fc3275973bea5b7b787cd332015/v8/client/network.go#L176 without capturing any relevant info especially the IP of the machine. So have just appended the err to the error stack trace as this made it difficult to pinpoint the exact reason/IP of the machine that was down.

chandanjainn commented 2 years ago

@jcmturner can we get this reviewed and merged please?

chandanjainn commented 2 years ago

Looks good I think we need something similar on dialSendUDP function as well. Would you mind adding that too?

@jcmturner done.

chandanjainn commented 2 years ago

@jcmturner removed the changes for sendDialUDP. even I missed that it was already handled :)

chandanjainn commented 2 years ago

@jcmturner done.

chandanjainn commented 2 years ago

@jcmturner checks have passed. can we merge and close this?

jcmturner commented 2 years ago

Thanks for the contribution!