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

Make implementing Close required by reader.Reader #20455

Merged
merged 11 commits into from
Aug 13, 2020

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Aug 5, 2020

What does this PR do?

This PR changes the reader.Reader interface to require readers implement a Close function.

Why is it important?

This lets Filebeat clean-up the goroutine in TimeoutReader.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
    - [ ] I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

Closes #19193

@kvch kvch added [zube]: In Review Team:Services (Deprecated) Label for the former Integrations-Services team labels Aug 5, 2020
@kvch kvch requested a review from urso August 5, 2020 18:12
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@elasticmachine
Copy link
Collaborator

elasticmachine commented Aug 5, 2020

💔 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20455 updated]

  • Start Time: 2020-08-12T13:26:29.509+0000

  • Duration: 77 min 25 sec

Test stats 🧪

Test Results
Failed 4
Passed 17822
Skipped 1925
Total 19751

Test errors

Expand to view the tests failures

  • Name: Build and Test / Auditbeat oss Mac OS X / TestEventReader – file_integrity

    • Age: 1
    • Duration: 2.79
    • Error Details: Failed
  • Name: Build and Test / Auditbeat oss Mac OS X / TestEventReader/updated – file_integrity

    • Age: 1
    • Duration: 1.14
    • Error Details: Failed
  • Name: Build and Test / Auditbeat oss Mac OS X / TestRaces – file_integrity

    • Age: 1
    • Duration: 1.28
    • Error Details: Failed
  • Name: Build and Test / Filebeat oss / test_default_settings – filebeat.tests.system.test_autodiscover.TestAutodiscover

    • Age: 1
    • Duration: 90.003
    • Error Details: Failed: Timeout >90.0s

Steps errors

Expand to view the steps failures

  • Name: Mage build test

    • Description: mage build test

    • Duration: 26 min 46 sec

    • Start Time: 2020-08-12T13:51:04.683+0000

    • log

  • Name: Mage build unitTest

    • Description: mage build unitTest

    • Duration: 2 min 31 sec

    • Start Time: 2020-08-12T14:00:38.245+0000

    • log

  • Name: Recursively delete the current directory from the workspace

    • Description: script returned exit code 1

    • Duration: 0 min 8 sec

    • Start Time: 2020-08-12T14:02:17.711+0000

    • log

  • Name: Make test

    • Description: make -C generator/_templates/metricbeat test

    • Duration: 1 min 4 sec

    • Start Time: 2020-08-12T13:51:55.151+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-08-12T14:43:15.998Z] + tar --version
[2020-08-12T14:43:16.290Z] + tar -xpf source.tgz
[2020-08-12T14:43:26.599Z] + rm source.tgz
[2020-08-12T14:43:26.611Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats
[2020-08-12T14:43:26.632Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Lint
[2020-08-12T14:43:26.717Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-08-12T14:43:26.800Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Winlogbeat-oss
[2020-08-12T14:43:26.886Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-08-12T14:43:26.968Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-08-12T14:43:27.060Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Dockerlogbeat
[2020-08-12T14:43:27.163Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Journalbeat-oss
[2020-08-12T14:43:27.243Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-08-12T14:43:27.323Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Packetbeat-Linux
[2020-08-12T14:43:27.409Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-08-12T14:43:27.488Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-08-12T14:43:27.569Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Heartbeat-oss
[2020-08-12T14:43:27.649Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-08-12T14:43:27.747Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-08-12T14:43:27.829Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-08-12T14:43:27.910Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-08-12T14:43:27.994Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-08-12T14:43:28.073Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-08-12T14:43:28.152Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Libbeat-x-pack
[2020-08-12T14:43:28.237Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-08-12T14:43:28.335Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Auditbeat-oss-Mac-OS-X
[2020-08-12T14:43:28.429Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Filebeat-x-pack-Mac-OS-X
[2020-08-12T14:43:28.517Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-08-12T14:43:28.598Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Filebeat-Windows
[2020-08-12T14:43:28.683Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-08-12T14:43:28.772Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-08-12T14:43:28.873Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Auditbeat-x-pack-Mac-OS-X
[2020-08-12T14:43:28.964Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-Windows
[2020-08-12T14:43:29.044Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-08-12T14:43:29.128Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-08-12T14:43:29.296Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-08-12T14:43:29.400Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Filebeat-x-pack
[2020-08-12T14:43:29.497Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Filebeat-oss
[2020-08-12T14:43:29.581Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Functionbeat-Mac-OS-X-x-pack
[2020-08-12T14:43:29.680Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Packetbeat-Mac-OS-X
[2020-08-12T14:43:29.792Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Heartbeat-Mac-OS-X
[2020-08-12T14:43:29.900Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Libbeat-oss
[2020-08-12T14:43:29.987Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests
[2020-08-12T14:43:30.085Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-OSS-Python-Integration-tests
[2020-08-12T14:43:30.165Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Libbeat-crosscompile
[2020-08-12T14:43:30.276Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Libbeat-stress-tests
[2020-08-12T14:43:30.358Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Functionbeat-Windows
[2020-08-12T14:43:30.444Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Heartbeat-Windows
[2020-08-12T14:43:30.529Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Packetbeat-Windows
[2020-08-12T14:43:30.616Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-08-12T14:43:31.021Z] + cat
[2020-08-12T14:43:31.021Z] + /usr/local/bin/runbld ./runbld-script --job-name elastic+beats+pull-request
[2020-08-12T14:43:31.021Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-08-12T14:43:37.619Z] runbld>>> runbld started
[2020-08-12T14:43:37.619Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-08-12T14:43:39.528Z] runbld>>> The following profiles matched the job 'elastic+beats+pull-request' in order of occurrence in the config (last value wins).
[2020-08-12T14:43:39.528Z] runbld>>> Matches in the system config:
[2020-08-12T14:43:39.528Z] runbld>>> - Matched ^elastic\+beats
[2020-08-12T14:43:39.528Z] runbld>>> - Matched ^elastic\+beats\+pull-request
[2020-08-12T14:43:40.470Z] runbld>>> Debug logging enabled.
[2020-08-12T14:43:40.471Z] runbld>>> Storing result
[2020-08-12T14:43:40.732Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-08-12T14:43:40.732Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200812144340-27647C12
[2020-08-12T14:43:40.732Z] runbld>>> Adding system facts.
[2020-08-12T14:43:41.676Z] runbld>>> Adding vcs info for the latest commit:  d9711d9d9aac0a55de1c98fa12018c6960892fa6
[2020-08-12T14:43:41.676Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-08-12T14:43:41.676Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-08-12T14:43:41.935Z] Processing JUnit reports with runbld...
[2020-08-12T14:43:41.935Z] + echo 'Processing JUnit reports with runbld...'
[2020-08-12T14:43:42.195Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-08-12T14:43:42.195Z] runbld>>> DURATION: 32ms
[2020-08-12T14:43:42.195Z] runbld>>> STDOUT: 40 bytes
[2020-08-12T14:43:42.195Z] runbld>>> STDERR: 49 bytes
[2020-08-12T14:43:42.195Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-08-12T14:43:42.195Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-20455
[2020-08-12T14:43:43.145Z] runbld>>> Storing build metadata: 
[2020-08-12T14:43:43.145Z] runbld>>> Adding test report.
[2020-08-12T14:43:43.145Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats
[2020-08-12T14:43:44.086Z] runbld>>> Found 136 test output files
[2020-08-12T14:43:45.025Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-08-12T14:43:45.025Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-08-12T14:43:45.025Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-08-12T14:43:45.025Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-08-12T14:43:45.025Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-08-12T14:43:45.025Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-08-12T14:43:45.285Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20455/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-08-12T14:43:47.850Z] runbld>>> Test output logs contained: Errors: 0 Failures: 4 Tests: 19601 Skipped: 1654
[2020-08-12T14:43:47.850Z] runbld>>> Storing result
[2020-08-12T14:43:47.850Z] runbld>>> FAILURES: 4
[2020-08-12T14:43:48.788Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-08-12T14:43:48.788Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200812144340-27647C12
[2020-08-12T14:43:48.788Z] runbld>>> Email notification disabled by environment variable.
[2020-08-12T14:43:48.788Z] runbld>>> Slack notification disabled by environment variable.
[2020-08-12T14:43:54.271Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-20455
[2020-08-12T14:43:54.376Z] [INFO] getVaultSecret: Getting secrets
[2020-08-12T14:43:54.457Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-08-12T14:43:55.210Z] + chmod 755 generate-build-data.sh
[2020-08-12T14:43:55.210Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20455/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20455/runs/10 FAILURE 4645440
[2020-08-12T14:43:55.210Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20455/runs/10/steps/?limit=10000 -o steps-info.json
[2020-08-12T14:43:58.439Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20455/runs/10/tests/?status=FAILED -o tests-errors.json
[2020-08-12T14:43:58.989Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20455/runs/10/log/ -o pipeline-log.txt

@kvch kvch added the needs_backport PR is waiting to be backported to other branches. label Aug 5, 2020
@kvch kvch force-pushed the fix-libbeat-timeout-reader-go-routine branch from 5e2c990 to 10bf717 Compare August 6, 2020 13:42
@kvch kvch force-pushed the fix-libbeat-timeout-reader-go-routine branch from 10bf717 to 43d4b09 Compare August 10, 2020 14:42
@kvch
Copy link
Contributor Author

kvch commented Aug 10, 2020

Failing tests are related.

@kvch kvch force-pushed the fix-libbeat-timeout-reader-go-routine branch from 78ec778 to 233aec3 Compare August 11, 2020 12:22
@kvch
Copy link
Contributor Author

kvch commented Aug 12, 2020

Failing tests are unrelated.

@kvch kvch merged commit 315a17e into elastic:master Aug 13, 2020
@kvch kvch removed the needs_backport PR is waiting to be backported to other branches. label Aug 13, 2020
@kvch kvch added the v7.10.0 label Aug 13, 2020
kvch added a commit to kvch/beats that referenced this pull request Aug 26, 2020
This PR changes the `reader.Reader` interface to require readers implement a `Close` function.

This lets Filebeat clean-up the goroutine in `TimeoutReader`.

Closes elastic#19193
(cherry picked from commit 315a17e)
kvch added a commit that referenced this pull request Aug 26, 2020
This PR changes the `reader.Reader` interface to require readers implement a `Close` function.

This lets Filebeat clean-up the goroutine in `TimeoutReader`.

Closes #19193
(cherry picked from commit 315a17e)
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
## What does this PR do?

This PR changes the `reader.Reader` interface to require readers implement a `Close` function.

## Why is it important?

This lets Filebeat clean-up the goroutine in `TimeoutReader`.

## Related issues

Closes elastic#19193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Services (Deprecated) Label for the former Integrations-Services team v7.10.0 [zube]: In Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[libbeat] Is there a goroutine leak in libbeat?
3 participants