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

[v13] Work around go-ldap's lack of errors.Is support #30560

Merged
merged 1 commit into from
Aug 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/srv/desktop/windows_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,13 @@ func (s *WindowsService) initializeLDAP() error {
s.ldapInitialized = false

// failures due to timeouts might be transient, so retry more frequently
//
// TODO(zmb3): errors.Is does not work properly on ldap.Error
// (remove the extra errors.As() check when https://github.com/go-ldap/ldap/pull/461 merges)
retryAfter := windowsDesktopServiceCertRetryInterval
if errors.Is(err, context.DeadlineExceeded) {
var ldapErr *ldap.Error
if errors.Is(err, context.DeadlineExceeded) ||
(errors.As(err, &ldapErr) && errors.Is(ldapErr.Err, context.DeadlineExceeded)) {
retryAfter = ldapTimeoutRetryInterval
}

Expand Down