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: resolve connection issues for aggregators on different nodes #615

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

akwaed
Copy link

@akwaed akwaed commented Dec 11, 2024

This commit addresses the issue where aggregators failed to connect to the server when running on different nodes. The changes include updates to shm.py and channel_manager.py to improve compatibility and error handling for multi-node setups.

Changes in shm.py:

  • Refactored LIFLSharedMemoryBackend to dynamically support configuration of sockmap_server_ip and rpc_server_ip for non-localhost setups.
  • Enhanced shared memory cleanup logic to handle scenarios where segments may already be unlinked by another process.
  • Improved _rx_task logging to provide clearer debugging information during message reception and processing.
  • Added safeguards to ensure graceful handling of unexpected messages and connection issues.

Changes in channel_manager.py:

  • Modified _setup_backends to correctly configure distinct backends for each channel, ensuring multi-node communication is supported.
  • Added logging for missing backends to help diagnose misconfigurations in config.json.
  • Enhanced default backend assignment logic to avoid conflicts when channels lack explicitly defined backends.

Impact:

  • Fixes aggregator connection failures when running across multiple nodes.
  • Improves resilience and debuggability of shared memory operations and backend setups.
  • Ensures channel management adapts dynamically to different configurations.

This commit has been tested with coord_hier_syncfl_mnist

Description

Please provide a meaningful description of what this change will do, or is for. Bonus points for including links to
related issues, other PRs, or technical references.

Note that by not including a description, you are asking reviewers to do extra work to understand the context of this
change, which may lead to your PR taking much longer to review, or result in it not being reviewed at all.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

This commit addresses the issue where aggregators failed to connect to the server when running on different nodes. The changes include updates to `shm.py` and `channel_manager.py` to improve compatibility and error handling for multi-node setups.

### Changes in shm.py:
- Refactored `LIFLSharedMemoryBackend` to dynamically support configuration of `sockmap_server_ip` and `rpc_server_ip` for non-localhost setups.
- Enhanced shared memory cleanup logic to handle scenarios where segments may already be unlinked by another process.
- Improved `_rx_task` logging to provide clearer debugging information during message reception and processing.
- Added safeguards to ensure graceful handling of unexpected messages and connection issues.

### Changes in channel_manager.py:
- Modified `_setup_backends` to correctly configure distinct backends for each channel, ensuring multi-node communication is supported.
- Added logging for missing backends to help diagnose misconfigurations in `config.json`.
- Enhanced default backend assignment logic to avoid conflicts when channels lack explicitly defined backends.

### Impact:
- Fixes aggregator connection failures when running across multiple nodes.
- Improves resilience and debuggability of shared memory operations and backend setups.
- Ensures channel management adapts dynamically to different configurations.

This commit has been tested with coord_hier_syncfl_mnist
@myungjin myungjin requested a review from ShixiongQi December 12, 2024 19:55
Copy link
Contributor

@myungjin myungjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. I left minor comments. please consider to address them.


logger.debug("channel leave completed gracefully")

# def leave(self, channel) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please remove these commented lines?


if self._backend:
_ = run_async(_inner(self._backend), self._backend.loop())

for k, v in self._backends.items():
_ = run_async(_inner(v), v.loop())
_ = run_async(_inner(v), v.loop())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: please add a new line.

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.

2 participants