Skip to content

undefined: errUnexpectedRead #3549

@Udhayarajan

Description

@Udhayarajan

errUnexecptedRead referred on internal/pool/pool.go is undefined

Expected Behavior

ability to compile on Windows

Current Behavior

Unable to compile, error:

# github.com/redis/go-redis/v9/internal/pool
..\..\vendor\github.com\redis\go-redis\v9\internal\pool\pool.go:809:47: undefined: errUnexpectedRead

Possible Solution

The usage of

if p.cfg.PushNotificationsEnabled && err == errUnexpectedRead {

is from:

var errUnexpectedRead = errors.New("unexpected read from socket")

But it has build tag, which don't have Windows

//go:build linux || darwin || dragonfly || freebsd || netbsd || openbsd || solaris || illumos

Environment

OS: Windows 11
redis_version:8.2.2
sdk:

  1. redis: v9.16.0-beta.1.0.20251017142310-1e6ee0674016 (master)
  2. redisotel: v9.16.0-beta.1.0.20251017142310-1e6ee0674016 (master)

Possible Implementation

IMO we can move the errUnexpectedRead from conn_check.go to pool.go, but I haven't checked the feasibility

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions