The timeout duration for starting/stopping a switch may be a little bit short. #58
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.
I've encountered a problem when creating/stopping a topology containing 144 hosts and 13 switches with p4utils. There is a high probability that the program will raise a ChildProcessError which saying "P4 swich xx did not start/stop correctly.". I digged into the source code and found that the error was from the if sentence: "if not wait_condition(self.switch_status, True, timeout=SWITCH_START_TIMEOUT".
To my understanding, the time limit for a child process to create or stop a P4 switch may not be long enough when creating a larger topology, so I changed the global variables "SWITCH_START_TIMEOUT" and "SWITCH_STOP_TIMEOUT" from 10 to 60. This solution worked and the problem didn't occured again after I changed the code.
I'm not certained whether my understanding is correct, so I make this pull request. I will appreciate it if you can give me a reply, and I hope this adjustment to the code can help others meeting the same problem