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

fix: properly handle http.ErrServerClosed #234

Merged
merged 2 commits into from
Jul 18, 2022

Conversation

kruskall
Copy link
Member

Logs API server: the server was ignoring ErrServerClosed and logging an error.

APM Data server: the server was using an equality check with the error message but
it was never satisfied because of a typo ('server closed' vs 'Server closed'), leading
to an error message.

Both servers are now handling the error and logging a message that the server stopped
successfully. The code is using go 1.13 errors to avoid comparing strings and for better
compatibility.

Logs API server: the server was ignoring ErrServerClosed and logging an error.

APM Data server: the server was using an equality check with the error message but
it was never satisfied because of a typo ('server closed' vs 'Server closed'), leading
to an error message.

Both servers are now handling the error and logging a message that the server stopped
successfully. The code is using go 1.13 errors to avoid comparing strings and for better
compatibility.
@github-actions github-actions bot added the aws-λ-extension AWS Lambda Extension label Jul 14, 2022
@apmmachine
Copy link

apmmachine commented Jul 14, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-07-18T14:43:54.013+0000

  • Duration: 17 min 37 sec

Test stats 🧪

Test Results
Failed 0
Passed 220
Skipped 4
Total 224

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

@marclop marclop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just left a couple of suggestions on rewording the errors and using a non-capitalized error to comply with static analysis tools.

apm-lambda-extension/extension/http_server.go Outdated Show resolved Hide resolved
apm-lambda-extension/extension/http_server.go Outdated Show resolved Hide resolved
Co-authored-by: Marc Lopez Rubio <marc5.12@outlook.com>
@kruskall kruskall merged commit 20aa3c5 into elastic:main Jul 18, 2022
@kruskall kruskall deleted the fix/handle-server-closed branch July 18, 2022 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws-λ-extension AWS Lambda Extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants