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

fix: worker: Connect when --listen is not set #11292

Closed
wants to merge 2 commits into from

Conversation

rjan90
Copy link
Contributor

@rjan90 rjan90 commented Sep 23, 2023

Proposed Changes

Fix regression introduces in #11141, where a remote lotus-worker was unable to connect, unless the --listen flag was specified.

Additional Info

Starting the lotus-worker on a remote server w/different IP-address, failed unless the --listen was set after adding #11141.

Testing cases:

  • Running a remote lotus-worker connecting to a lotus-miner with an IPv4 MINER_AP_INFO, and without --listen flag:
./lotus-worker run --no-default=true --unseal=true
2023-09-23T07:41:22.600Z        INFO    main    lotus-worker/main.go:298        Starting lotus worker
2023-09-23T07:41:22.604Z        INFO    main    lotus-worker/main.go:384        Remote version 1.23.4-rc1+mainnet+git.c7b3d84cc.dirty+api1.5.0
----
2023-09-23T07:41:22.627Z        INFO    main    lotus-worker/main.go:725        Making sure no local tasks are running
2023-09-23T07:41:23.441Z        INFO    main    lotus-worker/main.go:748        Worker registered successfully, waiting for tasks
  • Running a remote lotus-worker with IPv6, and without --listen flag:
./lotus-worker run --no-default=true --unseal=true
-----
2023-09-25T13:26:51.408+0200    INFO    main    lotus-worker/main.go:556        Opening local storage; connecting to master
2023-09-25T13:26:51.417+0200    INFO    main    lotus-worker/main.go:630        Setting up control endpoint at [::1]:3456
2023-09-25T13:26:51.419+0200    INFO    main    lotus-worker/main.go:725        Making sure no local tasks are running
2023-09-25T13:26:51.472+0200    INFO    main    lotus-worker/main.go:748        Worker registered successfully, waiting for tasks

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

Connect to newAddress
use net.JoinHostPort(minerIP, minerPort) to handle both IPv4 and IPv6 addresses.
@rjan90
Copy link
Contributor Author

rjan90 commented Sep 25, 2023

Closing in favour of: #11294, as its more correctly to merge into master, then backport into release/v1.23.4.

This branch was based off release/v1.23.4, so it has some additional commits (changelog changes that was not in master).

@rjan90 rjan90 closed this Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant