{ "id": "152081", "key": "TIMOB-20036", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "16997", "name": "Release 5.2.0", "archived": false, "released": true, "releaseDate": "2016-02-23" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-02-16T06:33:41.000+0000", "created": "2015-10-15T15:37:30.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "httpclient", "httpclient.abort", "module_network", "qe-manualtest", "qe-testadded" ], "versions": [ { "id": "16904", "description": "Release 5.0.2", "name": "Release 5.0.2", "archived": true, "released": true, "releaseDate": "2015-10-01" } ], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-02-16T06:33:47.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "If I try to cancel a just created HttpClient request (eg on a input onchange search), I got the below errors.\r\n\r\nWith SDK 3.4.1 I got this error:\r\n\r\n{noformat}\r\n[ERROR] : TiHttpClient: (TiHttpClient-3) [0,4790] HTTP Error (java.lang.IllegalStateException): Connection pool shut down.\r\n[ERROR] : TiHttpClient: java.lang.IllegalStateException: Connection pool shut down.\r\n[ERROR] : TiHttpClient: \tat org.apache.http.impl.conn.tsccm.ConnPoolByRoute.getEntryBlocking(ConnPoolByRoute.java:289)\r\n[ERROR] : TiHttpClient: \tat org.apache.http.impl.conn.tsccm.ConnPoolByRoute$1.getPoolEntry(ConnPoolByRoute.java:243)\r\n[ERROR] : TiHttpClient: \tat org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1.getConnection(ThreadSafeClientConnManager.java:181)\r\n[ERROR] : TiHttpClient: \tat org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:331)\r\n[ERROR] : TiHttpClient: \tat org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:560)\r\n[ERROR] : TiHttpClient: \tat org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:658)\r\n[ERROR] : TiHttpClient: \tat org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:642)\r\n[ERROR] : TiHttpClient: \tat ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1341)\r\n[ERROR] : TiHttpClient: \tat java.lang.Thread.run(Thread.java:818)\r\n{noformat}\r\n\r\nWith SDK 5.0.0 instead: \r\n\r\n{noformat}\r\n[ERROR] : TiHttpClient: (TiHttpClient-7) [0,9478] HTTP Error (java.lang.NullPointerException): Attempt to invoke interface method 'int org.apache.http.StatusLine.getStatusCode()' on a null object reference\r\n[ERROR] : TiHttpClient: java.lang.NullPointerException: Attempt to invoke interface method 'int org.apache.http.StatusLine.getStatusCode()' on a null object reference\r\n[ERROR] : TiHttpClient: \tat ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1354)\r\n[ERROR] : TiHttpClient: \tat java.lang.Thread.run(Thread.java:818)\r\n{noformat}\r\n\r\nI'm pretty sure this don't happen with 3.1 or 3.2 but I can't test it at the moment.\r\n\r\n\r\n\r\nTest apps here:\r\nhttps://www.dropbox.com/sh/g7a7n9emtu36fzc/AADrFBNZ8UthezDd0vmKGjM1a?dl=0\r\n\r\nTest code:\r\n{code:java}\r\nvar win = Titanium.UI.createWindow({layout:'vertical', height:Titanium.UI.FILL, backgroundColor:\"#FFF\"});\r\n\r\n\r\nvar button = Titanium.UI.createButton({top:50,title:\"create new request and cancel it after 50ms (will often throw error on logcat)\"});\r\nbutton.addEventListener('click', function(){\r\n\tvar n = Ti.Network.createHTTPClient();\r\n\tn.open(\"GET\", \"http://www.google.com\");\r\n\tn.send();\r\n\tsetInterval(function(){\r\n\t\tn.abort();\r\n\t},50);\r\n});\r\nwin.add(button);\r\n\r\nwin.open();\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: HttpClient.abort() on andorid throw errors if the request is just created", "creator": { "name": "c3k", "key": "c3k", "displayName": "carlo", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "c3k", "key": "c3k", "displayName": "carlo", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Window 7 x64 - Titanium SDK 3.4.1 - 5.0.2 - Android 5.1.1", "closedSprints": [ { "id": 536, "state": "closed", "name": "2015 Sprint 25 SDK", "startDate": "2015-12-05T01:30:40.415Z", "endDate": "2015-12-19T01:30:00.000Z", "completeDate": "2015-12-29T03:19:42.127Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "372461", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR: https://github.com/appcelerator/titanium_mobile/pull/7559", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-12-08T23:28:24.000+0000", "updated": "2015-12-08T23:28:24.000+0000" }, { "id": "372475", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR merged.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-12-09T02:45:12.000+0000", "updated": "2015-12-09T02:45:12.000+0000" }, { "id": "374868", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\n\r\nNo errors seen on httpClient.abort().\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.5.0.201601131150\r\nTi SDK : 5.2.0.v20160114021251\r\nTi CLI : 5.0.5\r\nAlloy : 1.7.26\r\nMAC Yosemite : 10.10.5\r\nAppc NPM : 4.2.2\r\nAppc CLI : 5.1.0\r\nNode: v0.12.27\r\nNexus 6P - Android 6.0\r\nOne Plus One - Android 5.1.1", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-19T21:47:11.000+0000", "updated": "2016-01-19T21:47:11.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }