Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Misleading error is raised when host address is already binded locally. #180

Description

@laertispappas

Expected Behavior

The error that is being raised is super misleading when the address is already binded to another process. Ideally we should get something like

: Address already in use - bind(2) for "127.0.0.1" port 3001 (Errno::EADDRINUSE)
... backtrace ...

Actual Behavior

Panic error with no context in it.

❯ ./spec/support/go_server/main 3000 s                                                                                                                    [3.1.2]
2022/12/07 22:55:29 Let's do this!
2022/12/07 22:55:29 Starting server on port 3000 for namespace s
panic: Client must be created with client.Dial() or client.NewLazyClient()

goroutine 203 [running]:
go.temporal.io/sdk/internal.NewWorker(...)
        /Users/laertipapa/go/pkg/mod/go.temporal.io/sdk@v1.15.0/internal/worker.go:233
go.temporal.io/sdk/worker.New({0x0?, 0x0?}, {0x300c11c?, 0x23?}, {0xa, 0x0, 0x0, 0x0, 0x0, 0x8, ...})
        /Users/laertipapa/go/pkg/mod/go.temporal.io/sdk@v1.15.0/worker/worker.go:223 +0xdd
go.temporal.io/server/service/worker/scanner.(*Scanner).Start(0xc00030d8f0)
        /Users/laertipapa/go/pkg/mod/go.temporal.io/server@v1.17.5/service/worker/scanner/scanner.go:153 +0x7a6
go.temporal.io/server/service/worker.(*Service).startScanner(0xc0002d8180)
        /Users/laertipapa/go/pkg/mod/go.temporal.io/server@v1.17.5/service/worker/service.go:472 +0x22a
go.temporal.io/server/service/worker.(*Service).Start(0x0?)
        /Users/laertipapa/go/pkg/mod/go.temporal.io/server@v1.17.5/service/worker/service.go:374 +0x3dc
go.temporal.io/server/service/worker.ServiceLifetimeHooks.func1.1({0x34d8248?, 0xc0002d8180?}, 0xc000368880?)
        /Users/laertipapa/go/pkg/mod/go.temporal.io/server@v1.17.5/service/worker/fx.go:155 +0x2c
created by go.temporal.io/server/service/worker.ServiceLifetimeHooks.func1
        /Users/laertipapa/go/pkg/mod/go.temporal.io/server@v1.17.5/service/worker/fx.go:153 +0x98

Steps to Reproduce the Problem

  1. Compile the server running here: https://github.com/temporalio/sdk-ruby/tree/main/spec/support/go_server
  2. Start which ever process you like locally in port X
  3. Try to run the go server in port X: ./main 3001 s

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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