Skip to content

Fix memory leak in netty connection pool #16168

Fix memory leak in netty connection pool

Fix memory leak in netty connection pool #16168

Triggered via pull request June 18, 2024 00:31
Status Success
Total duration 10m 49s
Artifacts

ci.yml

on: pull_request
Matrix: Build and Test
Matrix: Jmh CachedDateHeaderBenchmark
Matrix: Jmh CookieDecodeBenchmark
Matrix: Jmh EndpointBenchmark
Matrix: Jmh HttpCollectEval
Matrix: Jmh HttpCombineEval
Matrix: Jmh HttpNestedFlatMapEval
Matrix: Jmh HttpRouteTextPerf
Matrix: Jmh ProbeContentTypeBenchmark
Matrix: Jmh SchemeDecodeBenchmark
Matrix: Jmh ServerInboundHandlerBenchmark
Matrix: Jmh UtilBenchmark
Matrix: Performance Benchmarks (SimpleEffectBenchmarkServer)
Matrix: Performance Benchmarks (PlainTextBenchmarkServer)
Matrix: Unsafe Scoverage
Matrix: Release Drafter
Matrix: Publish Artifacts
Matrix: Cache Jmh benchmarks
Fit to window
Zoom out
Zoom in

Annotations

3 errors and 8 warnings
Release Drafter (ubuntu-latest, 2.13.10, temurin@8)
Resource not accessible by integration { name: 'HttpError', id: '9556857283', status: 403, response: { url: 'https://api.github.com/repos/zio/zio-http/issues/2907/labels', status: 403, headers: { 'access-control-allow-origin': '*', 'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset', connection: 'close', 'content-encoding': 'gzip', 'content-security-policy': "default-src 'none'", 'content-type': 'application/json; charset=utf-8', date: 'Tue, 18 Jun 2024 00:32:30 GMT', 'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin', server: 'GitHub.com', 'strict-transport-security': 'max-age=31536000; includeSubdomains; preload', 'transfer-encoding': 'chunked', vary: 'Accept-Encoding, Accept, X-Requested-With', 'x-accepted-github-permissions': 'issues=write; pull_requests=write', 'x-content-type-options': 'nosniff', 'x-frame-options': 'deny', 'x-github-api-version-selected': '2022-11-28', 'x-github-media-type': 'github.v3; format=json', 'x-github-request-id': 'FFC5:30A6C3:AA0CC17:AB97510:6670D59E', 'x-ratelimit-limit': '5000', 'x-ratelimit-remaining': '4978', 'x-ratelimit-reset': '1718673877', 'x-ratelimit-resource': 'core', 'x-ratelimit-used': '22', 'x-xss-protection': '0' }, data: { message: 'Resource not accessible by integration', documentation_url: 'https://docs.github.com/rest/issues/labels#add-labels-to-an-issue', status: '403' } }, request: { method: 'POST', url: 'https://api.github.com/repos/zio/zio-http/issues/2907/labels', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'probot/12.2.5 octokit-core.js/3.5.1 Node.js/16.20.2 (linux; x64)', authorization: 'token [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: '{"labels":["bug"]}', request: {} }, event: { id: '9556857283', name: 'pull_request', payload: { action: 'edited', changes: { body: { from: '/fixes #2906\r\n' + '\r\n' + "This is totally on me, big apologies on this one. In #2843 I changed the logic to use a listener on Netty's close future instead of forking a fiber to await on the future. However, I was not removing the listener when the channel would be reset. This is causing the `onResult` promise to being referenced and doesn't allow the response to be GC'd, causing a rather severe memory leak until the channel is closed.\r\n" + '\r\n' + 'In addition, I found that one of the main things that was contributing massively to the memory leak was using a much-bigger-than-needed ZStream buffer in `AsyncBody`. I added dynamic sizing of the buffer when the content length of the response is known. This way we reduce memory allocations significantly for small requests ' } }, number: 2907, organization: { avatar_url: 'https://avatars.githubusercontent.com/u/49655448?v=4', description: 'ZIO — Real World Functional Programming', events_url: 'https://api.github.com/orgs/zio/events', hooks_url: 'https://api.github.com/orgs/zio/hooks', id: 49655448, issues_url: 'https://api.github.com/orgs/zio/issues', login: 'zio', members_url: 'https://api.github.com/orgs/zio/members{/member}', node_id: 'MDEyOk9yZ2FuaXphdGlvbjQ5NjU1NDQ4', public_members_url: 'https://api.github.com/orgs/zio/public_members{/member}', repos_url: 'https://api.github.com/orgs/zio/repos', url: 'https://api.github.com/orgs/zio' }, pull_request: { _links: { comments: { href: 'https://api.github.co
Release Drafter (ubuntu-latest, 2.13.10, temurin@8)
Resource not accessible by integration { name: 'HttpError', id: '9556857283', status: 403, response: { url: 'https://api.github.com/repos/zio/zio-http/releases', status: 403, headers: { 'access-control-allow-origin': '*', 'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset', connection: 'close', 'content-encoding': 'gzip', 'content-security-policy': "default-src 'none'", 'content-type': 'application/json; charset=utf-8', date: 'Tue, 18 Jun 2024 00:32:32 GMT', 'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin', server: 'GitHub.com', 'strict-transport-security': 'max-age=31536000; includeSubdomains; preload', 'transfer-encoding': 'chunked', vary: 'Accept-Encoding, Accept, X-Requested-With', 'x-accepted-github-permissions': 'contents=write; contents=write,workflows=write', 'x-content-type-options': 'nosniff', 'x-frame-options': 'deny', 'x-github-api-version-selected': '2022-11-28', 'x-github-media-type': 'github.v3; format=json', 'x-github-request-id': 'FFC7:30A6C3:AA0D573:AB97E64:6670D5A0', 'x-ratelimit-limit': '5000', 'x-ratelimit-remaining': '4976', 'x-ratelimit-reset': '1718673877', 'x-ratelimit-resource': 'core', 'x-ratelimit-used': '24', 'x-xss-protection': '0' }, data: { message: 'Resource not accessible by integration', documentation_url: 'https://docs.github.com/rest/releases/releases#create-a-release', status: '403' } }, request: { method: 'POST', url: 'https://api.github.com/repos/zio/zio-http/releases', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'probot/12.2.5 octokit-core.js/3.5.1 Node.js/16.20.2 (linux; x64)', authorization: 'token [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: '{"target_commitish":"refs/pull/2907/merge","name":"v3.0.0 🌈","tag_name":"v3.0.0","body":"## Changes\\n\\n- Htmx attributes are unimportable @daharon (#2910)\\n- Avoid allocation of new path when resolving path ambiguities @kyri-petrou (#2904)\\n- Try all resolved IP addresses when client fails to connect @kyri-petrou (#2905)\\n- Fix for routes with different parameter names @kyri-petrou (#2903)\\n- fix: Ignore everything after closing boundary when parsing multi form data @seakayone (#2862)\\n- Fix OpenAPI security schema (#2813) @987Nabil (#2893)\\n- Implement streaming of multipart field data @kyri-petrou (#2899)\\n- Remove leading/trailing whitespaces from rendered authorization header @kyri-petrou (#2900)\\n- Simpler default `Endpoint#implement` (#2811) @987Nabil (#2894)\\n- fix: broken link in readme @ezhil56x (#2883)\\n- Use text over application media type for file serving; add charset @987Nabil (#2890)\\n- add tests for Routes.serveDirectory and Routes.serveResources @sullivan- (#2891)\\n- Endpoints as list in CodeGen to avoid duplicate key elimination (#2836) @987Nabil (#2892)\\n- Prefer user given content type over default generation (#2748) @987Nabil (#2896)\\n- Add `Server.serve` variant that accepts `Route` (#2805) @987Nabil (#2895)\\n- Fix Client manual interruption @kyri-petrou (#2889)\\n- Remove invalid `HttpApp` references @mijicd (#2881)\\n- Some tiny doc fixes. @sullivan- (#2884)\\n- Add a resourcePrefix for Middleware.serveResources @sullivan- (#2887)\\n- Docs/improve readme @syedbarimanjan (#2880)\\n- Don\'t share the Scope in `ContentTypeSpec` @kyri-petrou (#2886)\\n- Implement dynamic resizing of `StreamingForm.Buffer` @kyri-petrou (#2882)\\n- Fix serving of static files over SSL @kyri-petrou (#2879)\\n- Add line breaks in key features section @gbarrett-makeit (#2874)\\n\\n## 🧰 Maintenance\\n\\n- Update README.md @github-actions (#2877)\
Release Drafter (ubuntu-latest, 2.13.10, temurin@8)
HttpError: Resource not accessible by integration at /home/runner/work/_actions/release-drafter/release-drafter/v5/dist/index.js:8462:21 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Job.doExecute (/home/runner/work/_actions/release-drafter/release-drafter/v5/dist/index.js:30793:18) HttpError: Resource not accessible by integration at /home/runner/work/_actions/release-drafter/release-drafter/v5/dist/index.js:8462:21 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Job.doExecute (/home/runner/work/_actions/release-drafter/release-drafter/v5/dist/index.js:30793:18) { name: 'AggregateError', event: { id: '9556857283', name: 'pull_request', payload: { action: 'edited', changes: { body: { from: '/fixes #2906\r\n' + '\r\n' + "This is totally on me, big apologies on this one. In #2843 I changed the logic to use a listener on Netty's close future instead of forking a fiber to await on the future. However, I was not removing the listener when the channel would be reset. This is causing the `onResult` promise to being referenced and doesn't allow the response to be GC'd, causing a rather severe memory leak until the channel is closed.\r\n" + '\r\n' + 'In addition, I found that one of the main things that was contributing massively to the memory leak was using a much-bigger-than-needed ZStream buffer in `AsyncBody`. I added dynamic sizing of the buffer when the content length of the response is known. This way we reduce memory allocations significantly for small requests ' } }, number: 2907, organization: { avatar_url: 'https://avatars.githubusercontent.com/u/49655448?v=4', description: 'ZIO — Real World Functional Programming', events_url: 'https://api.github.com/orgs/zio/events', hooks_url: 'https://api.github.com/orgs/zio/hooks', id: 49655448, issues_url: 'https://api.github.com/orgs/zio/issues', login: 'zio', members_url: 'https://api.github.com/orgs/zio/members{/member}', node_id: 'MDEyOk9yZ2FuaXphdGlvbjQ5NjU1NDQ4', public_members_url: 'https://api.github.com/orgs/zio/public_members{/member}', repos_url: 'https://api.github.com/orgs/zio/repos', url: 'https://api.github.com/orgs/zio' }, pull_request: { _links: { comments: { href: 'https://api.github.com/repos/zio/zio-http/issues/2907/comments' }, commits: { href: 'https://api.github.com/repos/zio/zio-http/pulls/2907/commits' }, html: { href: 'https://github.com/zio/zio-http/pull/2907' }, issue: { href: 'https://api.github.com/repos/zio/zio-http/issues/2907' }, review_comment: { href: 'https://api.github.com/repos/zio/zio-http/pulls/comments{/number}' }, review_comments: { href: 'https://api.github.com/repos/zio/zio-http/pulls/2907/comments' }, self: { href: 'https://api.github.com/repos/zio/zio-http/pulls/2907' }, statuses: { href: 'https://api.github.com/repos/zio/zio-http/statuses/d86916f34f544f79ddc9e77ac825c45c2cd30a60' } }, active_lock_reason: null, additions: 151, assignee: null, assignees: [], author_association: 'COLLABORATOR', auto_merge: null, base: { label: 'zio:main', ref: 'main', repo: { allow_auto_merge: true, allow_forking: true, allow_merge_commit: false, allow_rebase_merge: true, allow_squash_merge: true, allow_update_branch: true, archive_url: 'https://api.github.com/repos/zio/zio-http/{archive_format}{/ref}', archived: false, assignees_url: 'https://api.github.com/repos/zio/zio-http/ass
Release Drafter (ubuntu-latest, 2.13.10, temurin@8)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: release-drafter/release-drafter@v5. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Build and Test (ubuntu-latest, 3.3.3, graal_graalvm@21)
Please remove "components: 'native-image'" from your workflow file. It is automatically included since GraalVM for JDK 17: https://github.com/oracle/graal/pull/5995
Build and Test (ubuntu-latest, 2.12.19, graal_graalvm@21)
Please remove "components: 'native-image'" from your workflow file. It is automatically included since GraalVM for JDK 17: https://github.com/oracle/graal/pull/5995
Performance Benchmarks (SimpleEffectBenchmarkServer) (ubuntu-latest, 2.13.14, temurin@8)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Performance Benchmarks (SimpleEffectBenchmarkServer) (ubuntu-latest, 2.13.14, temurin@8)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Performance Benchmarks (PlainTextBenchmarkServer) (ubuntu-latest, 2.13.14, temurin@8)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Performance Benchmarks (PlainTextBenchmarkServer) (ubuntu-latest, 2.13.14, temurin@8)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Build and Test (ubuntu-latest, 2.13.14, graal_graalvm@21)
Please remove "components: 'native-image'" from your workflow file. It is automatically included since GraalVM for JDK 17: https://github.com/oracle/graal/pull/5995