-
Notifications
You must be signed in to change notification settings - Fork 694
Teamd :: fix for cleaning up the teamd processes correctly on teamd docker stop #1159
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
581e873
Send explicit signal to the teamd processes whenthe teamd docker exits.
judyjoseph d4b473b
Updates to take care of boundary conditions in the teamsyncd signal h…
judyjoseph b2c023e
Better way of signal Handling by setting a flag in the signal handler…
judyjoseph aa55cbb
Updated the logic so that teammgrd controls the lifecycle of teamd.
judyjoseph d991280
Minor change in the function defenition
judyjoseph 7264c8d
Updates based on the comments
judyjoseph c61135f
Minor update in teammgr.cpp
judyjoseph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| #include <iostream> | ||
| #include <team.h> | ||
| #include <signal.h> | ||
| #include "logger.h" | ||
| #include "select.h" | ||
| #include "netdispatcher.h" | ||
|
|
@@ -9,17 +10,36 @@ | |
| using namespace std; | ||
| using namespace swss; | ||
|
|
||
| TeamSync *syncPtr = NULL; | ||
|
|
||
| void sig_handler(int signo) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
the same
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Signal handler is only registered only for SIGTERM now. The handler will be called only on SIGTERM signal. |
||
| { | ||
| /* Stop the teamd processes present */ | ||
| if(syncPtr) | ||
| { | ||
| syncPtr->cleanTeamProcesses(signo); | ||
| } | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| int main(int argc, char **argv) | ||
| { | ||
| swss::Logger::linkToDbNative(TEAMSYNCD_APP_NAME); | ||
| DBConnector db("APPL_DB", 0); | ||
| DBConnector stateDb("STATE_DB", 0); | ||
| Select s; | ||
| TeamSync sync(&db, &stateDb, &s); | ||
| syncPtr = &sync; | ||
|
|
||
| NetDispatcher::getInstance().registerMessageHandler(RTM_NEWLINK, &sync); | ||
| NetDispatcher::getInstance().registerMessageHandler(RTM_DELLINK, &sync); | ||
|
|
||
| /* Register the signal handler for various signals */ | ||
| signal(SIGTERM, sig_handler); | ||
| signal(SIGINT, sig_handler); | ||
| signal(SIGQUIT, sig_handler); | ||
|
|
||
| while (1) | ||
| { | ||
| try | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.