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 #11294

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

rjan90
Copy link
Contributor

@rjan90 rjan90 commented Sep 25, 2023

Related Issues

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

Should be backported to the release/v1.23.4 branch.

Proposed Changes

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 rjan90 marked this pull request as ready for review September 25, 2023 12:53
@rjan90 rjan90 requested a review from a team as a code owner September 25, 2023 12:53
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.

3 participants