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

chore: catch error when demo server start #236

Conversation

Frapschen
Copy link
Contributor

It's better to catch any error during the demo OpAMP Server starting. e.g. the 4320 port already in use.

before this PR: if we start an OpAMP Server in the background, and then start another OpAMP Server, we will get:

fraps@CMQ server % ./bin/server 
2024/01/10 10:46:33.961345 [MAIN] OpAMP Server starting...
2024/01/10 10:46:33.963579 [MAIN] OpAMP Server running...

however, it fails to start the OpAMP Server.

with this PR's enhance:

fraps@CMQ server % ./bin/server
2024/01/10 10:49:12.296051 [MAIN] OpAMP Server starting...
2024/01/10 10:49:12.298014 [OPAMP] OpAMP server start fail: listen tcp 127.0.0.1:4320: bind: address already in use

It response the real status of the OpAMP server.

@Frapschen Frapschen requested a review from a team January 10, 2024 02:53
Copy link

codecov bot commented Jan 10, 2024

Codecov Report

Attention: 130 lines in your changes are missing coverage. Please review.

Comparison is base (efddaa2) 76.11% compared to head (51e1974) 72.65%.
Report is 42 commits behind head on main.

Files Patch % Lines
internal/certs.go 0.00% 118 Missing ⚠️
client/internal/httpsender.go 88.00% 2 Missing and 1 partial ⚠️
client/internal/mockserver.go 85.71% 2 Missing and 1 partial ⚠️
server/httpconnection.go 0.00% 2 Missing ⚠️
client/internal/clientcommon.go 90.90% 1 Missing ⚠️
client/internal/packagessyncer.go 0.00% 1 Missing ⚠️
client/internal/receivedprocessor.go 90.90% 1 Missing ⚠️
server/serverimpl.go 95.65% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
- Coverage   76.11%   72.65%   -3.47%     
==========================================
  Files          24       25       +1     
  Lines        1834     2022     +188     
==========================================
+ Hits         1396     1469      +73     
- Misses        326      443     +117     
+ Partials      112      110       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@srikanthccv srikanthccv 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

client/types/logger.go Outdated Show resolved Hide resolved
internal/examples/server/opampsrv/opampsrv.go Outdated Show resolved Hide resolved
@tigrannajaryan tigrannajaryan merged commit 62d8b60 into open-telemetry:main Jan 11, 2024
4 of 6 checks passed
@tigrannajaryan
Copy link
Member

Thank you @Frapschen

@Frapschen Frapschen deleted the catch_error_when_start_demo_server branch January 15, 2024 02:52
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.

3 participants