-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
feat: check port use by another process or not when startup #4656
feat: check port use by another process or not when startup #4656
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4656 +/- ##
============================================
- Coverage 48.41% 48.38% -0.03%
Complexity 1722 1722
============================================
Files 346 346
Lines 10827 10827
Branches 1078 1078
============================================
- Hits 5242 5239 -3
- Misses 5264 5266 +2
- Partials 321 322 +1 see 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 14 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
review again |
Hello, I am a serverless review bot on flows.network. Here are my reviews of code commits in this PR. The patches mentioned above relate to making improvements to the functionality of Apollo project by modifying the startup scripts and updating the CHANGES.md file. Overall, there are no potential problems identified in most of the patches, except for two. One patch raises concerns that the DetailsCommit 1The patch updates the CHANGES.md file by adding a new feature that checks if a port is being used by another process during startup. This feature has been added through pull request #4656. There are no potential problems identified in this patch. Commit 2This patch modifies the startup scripts for the Admin Service, Config Service, and Portal Service of the Apollo project. The modification changes the endpoint used to determine whether the service is up and running from There appear to be no potential problems associated with this patch. However, it might be worth checking to ascertain whether the update has any side effect on the expected behavior of the startup scripts or impacts other parts of the system. Commit 3This is a Patch to add a new feature There doesn't seem to be any potential problems with the patch. However, an important note is that using Commit 4Key Changes: Potential Problems: Commit 5The key change in this patch is to replace the use of curl with lsof to check port utilization. This change is made to the startup script of three services: apollo-adminservice, apollo-configservice, and apollo-portal. The patch can potentially reduce the resource consumption of the services since curl is a heavier tool than lsof. Additionally, there is a subjective improvement in code quality since lsof is a more direct tool for the use case, thus reducing the complexity of the code. One potential problem with this patch is that the new tool used is platform-dependent, and the script might not work on all supported environments. Therefore, further testing must be done to ensure its compatibility. |
review again |
Hello, I am a serverless review bot on flows.network. Here are my reviews of code commits in this PR. The patches modify the startup scripts of three different services in the Apollo project repository to add a feature to prevent conflicts and improve the overall stability of the application. Most of the changes are straightforward and seem to have no potential problems except for a few issues with permission and platform compatibility. However, it is important to ensure that each patch is tested to avoid any unforeseen issues. The most significant finding is that the patches aim to prevent port conflicts, which are a common cause of unexpected behavior in software applications. DetailsCommit 1This patch makes changes to the startup script of three different services: apollo-adminservice, apollo-configservice, and apollo-portal. The main change is that before running the server, the script will check if the port is already in use by another process. If it is, it will exit with an error message indicating which process is using it. This change can prevent multiple instances of the same service from running on the same port, which can cause conflicts and unexpected behavior. However, there are potential problems with this change. One issue is that the method used to check if the port is in use may not work in all situations. If the port is being used by a process that does not return an HTTP response, the script may not detect it. Another issue is that if the script is run as a non-root user, it may not have permission to run the Commit 2This is a patch that updates the The key change in this patch adds a new feature that checks if a port is being used by another process during startup. This can prevent conflicts and improve the overall stability of the application. There don't appear to be any potential problems with this patch as it only modifies documentation. However, it is important to note that the actual implementation of the new feature must be thoroughly tested to ensure it works as intended and does not introduce any new issues. Commit 3The patch changes the health check call for the apollo services from As a reviewer, I don't see any major issues with this patch. However, depending on the implementation of the Commit 4The patch adds a new command to the startup scripts of the Apollo Admin Service, Config Service, and Portal. The new command runs 'sudo lsof -i:$SERVER_PORT -sTCP:LISTEN -t' to list out the Process ID (PID) of the process that is listening on the specified port. The change seems harmless and can be expected to work. It improves the troubleshooting capabilities of the scripts by providing another way to find the process that is using a particular port. However, the change only works on Unix based OSes and may not work on Windows platforms. Another potential issue is that the sudo command may not be allowed on some systems, and the user might have to modify the script to remove the sudo command. Commit 5This patch is reverting a previous commit that added a new command to get the process ID of the application listening on a given port. The change modified the Commit 6Key Changes:
Potential Problems:
Commit 7This patch is related to three different shell scripts ( The key change reduces the number of dependencies required for startup and improves cross-platform compatibility, as There is one potential problem with this patch: if the URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What's the purpose of this PR
Give better experience to user when run
./scripts/startup.sh
Which issue(s) this PR fixes:
Fixes #4642 #4307
Brief changelog
apollo-portal
inAn example here, there is an process use port 8080 which isn't apollo config service,
so it's alway fail to startup with default port 8080
We change config service's port to 18080, then startup success.
Then if we want to run startup.sh again
pi@raspberrypi:~/apollo/2.2.0-SNAPSHOT/configservice $ ./scripts/startup.sh Fri 21 Apr 15:52:36 BST 2023 ==== apollo-configservice is running already with port 18080, pid 2235
checklist
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.CHANGES
log.