{"action":"closed","issue":{"url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/9290","repository_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang","labels_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/9290/labels{/name}","comments_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/9290/comments","events_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/9290/events","html_url":"https://github.com/ballerina-platform/ballerina-lang/issues/9290","id":336606411,"node_id":"MDU6SXNzdWUzMzY2MDY0MTE=","number":9290,"title":"[HTTP2] Memory leak occurred when payload is not consumed by Ballerina server","user":{"login":"ldclakmal","id":9639050,"node_id":"MDQ6VXNlcjk2MzkwNTA=","avatar_url":"https://avatars0.githubusercontent.com/u/9639050?v=4","gravatar_id":"","url":"https://api.github.com/users/ldclakmal","html_url":"https://github.com/ldclakmal","followers_url":"https://api.github.com/users/ldclakmal/followers","following_url":"https://api.github.com/users/ldclakmal/following{/other_user}","gists_url":"https://api.github.com/users/ldclakmal/gists{/gist_id}","starred_url":"https://api.github.com/users/ldclakmal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldclakmal/subscriptions","organizations_url":"https://api.github.com/users/ldclakmal/orgs","repos_url":"https://api.github.com/users/ldclakmal/repos","events_url":"https://api.github.com/users/ldclakmal/events{/privacy}","received_events_url":"https://api.github.com/users/ldclakmal/received_events","type":"User","site_admin":false},"labels":[{"id":896399673,"node_id":"MDU6TGFiZWw4OTYzOTk2NzM=","url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/labels/Component/HTTP","name":"Component/HTTP","color":"006b75","default":false},{"id":830057046,"node_id":"MDU6TGFiZWw4MzAwNTcwNDY=","url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/labels/Component/stdlib","name":"Component/stdlib","color":"006b75","default":false},{"id":1030428777,"node_id":"MDU6TGFiZWwxMDMwNDI4Nzc3","url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/labels/Resolution/InProgress","name":"Resolution/InProgress","color":"93c47d","default":false},{"id":684576167,"node_id":"MDU6TGFiZWw2ODQ1NzYxNjc=","url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/labels/Type/Bug","name":"Type/Bug","color":"1d76db","default":false}],"state":"closed","locked":false,"assignee":{"login":"ldclakmal","id":9639050,"node_id":"MDQ6VXNlcjk2MzkwNTA=","avatar_url":"https://avatars0.githubusercontent.com/u/9639050?v=4","gravatar_id":"","url":"https://api.github.com/users/ldclakmal","html_url":"https://github.com/ldclakmal","followers_url":"https://api.github.com/users/ldclakmal/followers","following_url":"https://api.github.com/users/ldclakmal/following{/other_user}","gists_url":"https://api.github.com/users/ldclakmal/gists{/gist_id}","starred_url":"https://api.github.com/users/ldclakmal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldclakmal/subscriptions","organizations_url":"https://api.github.com/users/ldclakmal/orgs","repos_url":"https://api.github.com/users/ldclakmal/repos","events_url":"https://api.github.com/users/ldclakmal/events{/privacy}","received_events_url":"https://api.github.com/users/ldclakmal/received_events","type":"User","site_admin":false},"assignees":[{"login":"ldclakmal","id":9639050,"node_id":"MDQ6VXNlcjk2MzkwNTA=","avatar_url":"https://avatars0.githubusercontent.com/u/9639050?v=4","gravatar_id":"","url":"https://api.github.com/users/ldclakmal","html_url":"https://github.com/ldclakmal","followers_url":"https://api.github.com/users/ldclakmal/followers","following_url":"https://api.github.com/users/ldclakmal/following{/other_user}","gists_url":"https://api.github.com/users/ldclakmal/gists{/gist_id}","starred_url":"https://api.github.com/users/ldclakmal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldclakmal/subscriptions","organizations_url":"https://api.github.com/users/ldclakmal/orgs","repos_url":"https://api.github.com/users/ldclakmal/repos","events_url":"https://api.github.com/users/ldclakmal/events{/privacy}","received_events_url":"https://api.github.com/users/ldclakmal/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2018-06-28T12:46:57Z","updated_at":"2018-12-07T05:51:51Z","closed_at":"2018-12-07T05:51:51Z","author_association":"CONTRIBUTOR","body":"**Description:**\r\nAn error occurred while a load testing with Ballerina HTTP/2 server. It is observed that only the ERROR message is displayed at `ballerina-internal.log` but the process can be continued.\r\n\r\n**Steps to reproduce:**\r\nThis was reproducible for 100 concurrency with a small (1KB) or large (40KB) JSON payload after invoking for around 1 minute. Lesser the concurrency, take more than 1 minute to reproduce.\r\n\r\nThere are 2 possible scenarios to reproduce.\r\n1. Jmeter HTTP1 Client -> Ballerina HTTP2 passthrough service -> Ballerina HTTP2 service.\r\n2. Jmeter HTTP2 Client -> Ballerina HTTP2 service with SSL enabled.\r\n\r\n### Scenario 1\r\n\r\n**Ballerina HTTP2 passthrough service**\r\n```\r\nimport ballerina/http;\r\nimport ballerina/log;\r\n\r\nendpoint http:Listener passthroughEP {\r\n    port:9090\r\n};\r\n\r\nendpoint http:Client nyseEP {\r\n    url:\"http://localhost:9191\",\r\n    httpVersion:\"2.0\"\r\n};\r\n\r\n@http:ServiceConfig {basePath:\"/passthrough\"}\r\nservice<http:Service> passthroughService bind passthroughEP {\r\n\r\n    @http:ResourceConfig {\r\n        path:\"/\"\r\n    }\r\n    passthrough (endpoint outboundEP, http:Request clientRequest) {\r\n        var response = nyseEP -> forward(\"/nyseStock/stocks\", clientRequest);\r\n        match response {\r\n            http:Response httpResponse => {\r\n                _ = outboundEP -> respond(httpResponse);\r\n            }\r\n            error e => {\r\n                http:Response errorResponse = new;\r\n                log:printError(\"Error\", err = e);\r\n                json errMsg = {\"error\":\"error occurred while invoking the service\"};\r\n                errorResponse.setJsonPayload(errMsg);\r\n                _ = outboundEP -> respond(errorResponse);\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\n**Ballerina HTTP2 service**\r\n```\r\nimport ballerina/http;\r\nimport ballerina/runtime;\r\nimport ballerina/io;\r\n\r\nendpoint http:Listener passthroughEP {\r\n    port:9191,\r\n    httpVersion:\"2.0\"\r\n};\r\n\r\n\r\n@http:ServiceConfig {basePath:\"/nyseStock\"}\r\nservice<http:Service> nyseStockQuote bind passthroughEP {\r\n\r\n    @http:ResourceConfig {\r\n        path:\"/stocks\"\r\n    }\r\n    stocks (endpoint outboundEP, http:Request clientRequest) {\r\n        http:Response res = new;\r\n\tvar payload = clientRequest.getJsonPayload();\r\n        match payload {\r\n            json j => res.setJsonPayload(j);\r\n            error err => io:println(err);\r\n        }\r\n        _ = outboundEP -> respond(res);\r\n    }\r\n}\r\n```\r\n\r\n### Scenario 2\r\n**Ballerina HTTP2 service with SSL enabled**\r\n```\r\nimport ballerina/http;\r\nimport ballerina/runtime;\r\nimport ballerina/io;\r\n\r\nendpoint http:Listener passthroughEP {\r\n    port:9191,\r\n    httpVersion:\"2.0\",\r\n    secureSocket: {\r\n       keyStore: {\r\n          path: \"${ballerina.home}/bre/security/ballerinaKeystore.p12\",\r\n          password: \"ballerina\"\r\n       }\r\n   }\r\n};\r\n\r\n\r\n@http:ServiceConfig {basePath:\"/nyseStock\"}\r\nservice<http:Service> nyseStockQuote bind passthroughEP {\r\n\r\n    @http:ResourceConfig {\r\n        path:\"/stocks\"\r\n    }\r\n    stocks (endpoint outboundEP, http:Request clientRequest) {\r\n        http:Response res = new;\r\n        json payload = {\"foo\":\"bar\"};\r\n        res.setJsonPayload(payload);\r\n        _ = outboundEP -> respond(res);\r\n    }\r\n}\r\n```\r\n\r\n**Observations**\r\n```\r\n[2018-06-28 17:34:06,405] ERROR {io.netty.util.ResourceLeakDetector} - LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information.\r\nRecent access records:\r\n```\r\n\r\n**Affected Versions:**\r\nBallerina-Platform-0.975.0"}}
{"actor":{"display_login":"ldclakmal"}}