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

[receiver/sqlquery] Fix memory leak and failing tests #31785

Merged
merged 5 commits into from
Mar 16, 2024

Conversation

crobert-1
Copy link
Member

@crobert-1 crobert-1 commented Mar 15, 2024

Description:

This PR includes two changes that are dependent on each other.

  1. Fix test failing in [chore] Update otel core libraries #31778. Explanation given here. All changes in integration_test.go are related to this.
  2. When the test was fixed, goleak started failing. The logs receiver opens a DB connection when it's started, but shutdown does not close the DB. This DB needs to be closed during shutdown to avoid a leaked goroutine. All changes outside of integration_test.go are for this.
  3. Since the memory leak changes were modifying errors, I moved from using multierr.append to errors.Join as well.

Link to tracking Issue:
Resolves #31782
Related to #31778

Testing:
Tests are passing

@github-actions github-actions bot added the receiver/sqlquery SQL query receiver label Mar 15, 2024
@github-actions github-actions bot requested a review from dmitryax March 15, 2024 22:34
}
}
}
return logs, nil
return logs, errors.Join(errs...)
Copy link
Member Author

Choose a reason for hiding this comment

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

errs was originally being put together in the above loop, but not returned. I assume this was a bug and errs should be returned.

@crobert-1 crobert-1 marked this pull request as ready for review March 15, 2024 23:33
@crobert-1 crobert-1 requested a review from a team as a code owner March 15, 2024 23:33
@TylerHelmuth TylerHelmuth merged commit 794cd24 into open-telemetry:main Mar 16, 2024
143 of 144 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 16, 2024
@crobert-1 crobert-1 deleted the sqlquery_shutdown branch March 16, 2024 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
receiver/sqlquery SQL query receiver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[receiver/sqlquery] Broken Test TestPostgresIntegrationLogsTrackingWithStorage
3 participants