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

Cherry-pick #19562 to 7.x: Use a cache instead of sync.Pool in script processor #19693

Merged
merged 2 commits into from
Jul 14, 2020

Conversation

adriansr
Copy link
Contributor

@adriansr adriansr commented Jul 7, 2020

Cherry-pick of PR #19562 to 7.x branch. Original message:

What does this PR do?

Updates the script processor to keep a simple cache of Javascript VM sessions instead of relying on sync.Pool for this task.

Why is it important?

The reasoning behind this change is to avoid sync.Pool discarding and re-allocating new sessions every garbage collection cycle. For large Javascript pipelines, allocating a new session is a very expensive operation that can take hundreds of milliseconds, even seconds to complete. This has a severe impact in ingestion rates.

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.

This updates the script processor to keep a simple cache of Javascript VM
sessions instead of relying on sync.Pool for this task. The size of this
cache can be controlled by the new `max_cached_sessions` option.

The reasoning behind this change is to avoid sync.Pool discarding and
re-allocating new sessions every garbage collection cycle. For large
Javascript pipelines, allocating a new session is a very expensive
operation that can take hundreds of milliseconds or even seconds to
complete. This has a severe impact in ingestion rates.

(cherry picked from commit 7930f9e)
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 7, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 7, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 7, 2020

❕ Build Aborted

Either there was a build timeout or someone aborted the build.'}

Pipeline View Test View Changes Artifacts

Expand to view the summary

Build stats

  • Build Cause: [Branch indexing]

  • Start Time: 2020-07-13T09:42:33.673+0000

  • Duration: 123 min 49 sec

Test stats 🧪

Test Results
Failed 0
Passed 8362
Skipped 1564
Total 9926

Steps errors

Expand to view the steps failures

  • Name: Mage build unitTest

    • Description: mage build unitTest

    • Duration: 3 min 35 sec

    • Start Time: 2020-07-13T10:13:29.958+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-13T11:02:00.626+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 22 sec

    • Start Time: 2020-07-13T10:11:33.091+0000

    • log

  • Name: Notifies GitHub of the status of a Pull Request

Log output

Expand to view the last 100 lines of log output

[2020-07-13T11:44:38.095Z] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2020-07-13T11:44:38.095Z] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[2020-07-13T11:44:38.095Z] 	at java.lang.Thread.run(Thread.java:748)
[2020-07-13T11:44:38.095Z] No artifacts found that match the file pattern "**/build/TEST*.out". Configuration error?
[2020-07-13T11:44:38.132Z] + FILE=auditbeat/build/coverage/full.cov
[2020-07-13T11:44:38.132Z] + [ -f auditbeat/build/coverage/full.cov ]
[2020-07-13T11:44:38.132Z] + FILE=filebeat/build/coverage/full.cov
[2020-07-13T11:44:38.132Z] + [ -f filebeat/build/coverage/full.cov ]
[2020-07-13T11:44:38.132Z] + FILE=heartbeat/build/coverage/full.cov
[2020-07-13T11:44:38.132Z] + [ -f heartbeat/build/coverage/full.cov ]
[2020-07-13T11:44:38.132Z] + FILE=libbeat/build/coverage/full.cov
[2020-07-13T11:44:38.132Z] + [ -f libbeat/build/coverage/full.cov ]
[2020-07-13T11:44:38.132Z] + FILE=metricbeat/build/coverage/full.cov
[2020-07-13T11:44:38.132Z] + [ -f metricbeat/build/coverage/full.cov ]
[2020-07-13T11:44:38.132Z] + FILE=packetbeat/build/coverage/full.cov
[2020-07-13T11:44:38.132Z] + [ -f packetbeat/build/coverage/full.cov ]
[2020-07-13T11:44:38.132Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-07-13T11:44:38.132Z] + [ -f winlogbeat/build/coverage/full.cov ]
[2020-07-13T11:44:38.132Z] + FILE=journalbeat/build/coverage/full.cov
[2020-07-13T11:44:38.132Z] + [ -f journalbeat/build/coverage/full.cov ]
[2020-07-13T11:44:38.973Z] + curl -sSLo codecov https://codecov.io/bash
[2020-07-13T11:44:39.242Z] + FILE=auditbeat/build/coverage/full.cov
[2020-07-13T11:44:39.242Z] + [ -f auditbeat/build/coverage/full.cov ]
[2020-07-13T11:44:39.242Z] + FILE=filebeat/build/coverage/full.cov
[2020-07-13T11:44:39.242Z] + [ -f filebeat/build/coverage/full.cov ]
[2020-07-13T11:44:39.242Z] + FILE=heartbeat/build/coverage/full.cov
[2020-07-13T11:44:39.242Z] + [ -f heartbeat/build/coverage/full.cov ]
[2020-07-13T11:44:39.242Z] + FILE=libbeat/build/coverage/full.cov
[2020-07-13T11:44:39.242Z] + [ -f libbeat/build/coverage/full.cov ]
[2020-07-13T11:44:39.242Z] + FILE=metricbeat/build/coverage/full.cov
[2020-07-13T11:44:39.242Z] + [ -f metricbeat/build/coverage/full.cov ]
[2020-07-13T11:44:39.242Z] + FILE=packetbeat/build/coverage/full.cov
[2020-07-13T11:44:39.242Z] + [ -f packetbeat/build/coverage/full.cov ]
[2020-07-13T11:44:39.242Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-07-13T11:44:39.242Z] + [ -f winlogbeat/build/coverage/full.cov ]
[2020-07-13T11:44:39.242Z] + FILE=journalbeat/build/coverage/full.cov
[2020-07-13T11:44:39.242Z] + [ -f journalbeat/build/coverage/full.cov ]
[2020-07-13T11:44:41.033Z] Failed in branch Filebeat x-pack
[2020-07-13T11:44:41.802Z] Failed in branch Filebeat oss
[2020-07-13T11:44:48.276Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats
[2020-07-13T11:44:48.681Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-07-13T11:44:48.782Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Lint
[2020-07-13T11:44:49.044Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-07-13T11:44:49.635Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Winlogbeat-oss
[2020-07-13T11:44:49.909Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-07-13T11:44:50.162Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Dockerlogbeat
[2020-07-13T11:44:50.421Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-07-13T11:44:50.661Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Journalbeat-oss
[2020-07-13T11:44:50.958Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-07-13T11:44:51.433Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-07-13T11:44:51.866Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-07-13T11:44:52.101Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-07-13T11:44:52.621Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-07-13T11:44:52.928Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-07-13T11:44:53.238Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-07-13T11:44:53.649Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Heartbeat-oss
[2020-07-13T11:44:54.196Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-07-13T11:44:54.638Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Libbeat-x-pack
[2020-07-13T11:44:55.167Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-07-13T11:44:55.851Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Filebeat-Windows
[2020-07-13T11:44:56.489Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-07-13T11:44:57.158Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Metricbeat-Windows
[2020-07-13T11:44:57.647Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Packetbeat-oss
[2020-07-13T11:44:58.194Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-07-13T11:44:58.805Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Generators-Beat-Linux
[2020-07-13T11:44:59.530Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Metricbeat-Python-integration-tests
[2020-07-13T11:45:00.229Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Libbeat-oss
[2020-07-13T11:45:01.054Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Libbeat-crosscompile
[2020-07-13T11:45:01.529Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Libbeat-stress-tests
[2020-07-13T11:45:02.572Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-07-13T11:45:02.886Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests
[2020-07-13T11:45:03.256Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-07-13T11:45:03.488Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Auditbeat-oss-Mac-OS-X
[2020-07-13T11:45:03.800Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Auditbeat-x-pack-Mac-OS-X
[2020-07-13T11:45:04.318Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-07-13T11:45:04.590Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-07-13T11:45:04.823Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-07-13T11:45:05.050Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Filebeat-x-pack-Mac-OS-X
[2020-07-13T11:45:05.356Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-07-13T11:45:05.615Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Filebeat-x-pack
[2020-07-13T11:45:05.863Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19693/src/github.com/elastic/beats/Filebeat-oss
[2020-07-13T11:45:06.466Z] + cat
[2020-07-13T11:45:06.466Z] + /usr/local/bin/runbld ./runbld-script
[2020-07-13T11:45:06.466Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-07-13T11:45:13.193Z] runbld>>> runbld started
[2020-07-13T11:45:13.193Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-07-13T11:45:14.631Z] runbld>>> The following profiles matched the job 'Beats/beats/PR-19693' in order of occurrence in the config (last value wins).
[2020-07-13T11:45:15.734Z] runbld>>> Debug logging enabled.
[2020-07-13T11:45:15.734Z] runbld>>> Storing result
[2020-07-13T11:45:15.908Z] Body did not finish within grace period; terminating with extreme prejudice
[2020-07-13T11:45:16.206Z] ERROR: runbld post build action failed.
[2020-07-13T11:45:16.207Z] Timeout has been exceeded
[2020-07-13T11:45:16.600Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-19693
[2020-07-13T11:45:17.208Z] [INFO] getVaultSecret: Getting secrets
[2020-07-13T11:45:17.545Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-07-13T11:45:22.900Z] + chmod 755 generate-build-data.sh
[2020-07-13T11:45:22.900Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19693/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19693/runs/1 ABORTED 7368888
[2020-07-13T11:45:22.900Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19693/runs/1/steps/?limit=10000 -o steps-info.json
[2020-07-13T11:45:32.815Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19693/runs/1/tests/?status=FAILED -o tests-errors.json
[2020-07-13T11:45:35.470Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19693/runs/1/log/ -o pipeline-log.txt

@adriansr adriansr merged commit 19b1aec into elastic:7.x Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants