Skip to content

Commit

Permalink
core/connpool: m code comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Oct 19, 2024
1 parent 4b42383 commit 6aaafd7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions intra/core/connpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,11 @@ func canread(sc syscall.Conn) error {
return fmt.Errorf("pool: sysconn: %w", err)
}

if useread {
if useread { // stackoverflow.com/q/12741386
ctlErr = raw.Read(func(fd uintptr) bool {
// pitfall: github.com/redis/go-redis/issues/3137
// 0 byte reads do not work to detect readability:
// see: go-review.googlesource.com/c/go/+/23227
// pitfalls: github.com/redis/go-redis/issues/3137
var buf [1]byte
n, err := syscall.Read(int(fd), buf[:])
switch {
Expand Down

0 comments on commit 6aaafd7

Please sign in to comment.