Implement primary hub reconnection logic when connected to failover hub#1381
Open
skarg wants to merge 1 commit into
Open
Implement primary hub reconnection logic when connected to failover hub#1381skarg wants to merge 1 commit into
skarg wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements BACnet/SC hub connector behavior to retry reconnecting to the primary hub while remaining connected to a failover hub, and updates the corresponding reconnection test to validate this behavior.
Changes:
- Add primary-retry scheduling/handling while in
CONNECTED_FAILOVER. - Extend hub-connector socket event handling to support restoring primary while failover is active.
- Update the hub-sc reconnection test to keep failover running while primary is restored.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/bacnet/datalink/bsc/bsc-hub-connector.c |
Adds state-machine logic to attempt primary reconnection while connected to failover, plus related socket-event handling. |
test/bacnet/datalink/hub-sc/src/main.c |
Adjusts reconnection test ordering to ensure primary restore is retried while failover remains connected. |
Comment on lines
+181
to
+185
| if (ret == BSC_SC_SUCCESS) { | ||
| hc->state = BSC_HUB_CONNECTOR_STATE_CONNECTING_PRIMARY_FROM_FAILOVER; | ||
| } else { | ||
| hub_connector_schedule_primary_retry(hc); | ||
| } |
Comment on lines
+322
to
+325
| } else if ( | ||
| sock_type == BSC_HUB_CONN_PRIMARY && | ||
| hc->state == | ||
| BSC_HUB_CONNECTOR_STATE_CONNECTING_PRIMARY_FROM_FAILOVER) { |
Comment on lines
+420
to
+422
| bws_dispatch_unlock(); | ||
| DEBUG_PRINTF("hub_connector_socket_event() <<<\n"); | ||
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.