Title: BufferError with Tornado and asyncio · Issue #1 · stackimpact/stackimpact-python · GitHub
Open Graph Title: BufferError with Tornado and asyncio · Issue #1 · stackimpact/stackimpact-python
X Title: BufferError with Tornado and asyncio · Issue #1 · stackimpact/stackimpact-python
Description: Problem Since adding the StackImpact agent to a Tornado/asyncio application, we started seeing BufferErrors like this: BufferError: Existing exports of data: object cannot be re-sized File "tornado/web.py", line 1513, in _execute self.fi...
Open Graph Description: Problem Since adding the StackImpact agent to a Tornado/asyncio application, we started seeing BufferErrors like this: BufferError: Existing exports of data: object cannot be re-sized File "tornado...
X Description: Problem Since adding the StackImpact agent to a Tornado/asyncio application, we started seeing BufferErrors like this: BufferError: Existing exports of data: object cannot be re-sized File "to...
Opengraph URL: https://github.com/stackimpact/stackimpact-python/issues/1
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"BufferError with Tornado and asyncio","articleBody":"## Problem\r\n\r\nSince adding the StackImpact agent to a Tornado/asyncio application, we started seeing `BufferError`s like this:\r\n```\r\nBufferError: Existing exports of data: object cannot be re-sized\r\n File \"tornado/web.py\", line 1513, in _execute\r\n self.finish()\r\n File \"tornado/web.py\", line 991, in finish\r\n self.flush(include_footers=True)\r\n File \"tornado/web.py\", line 947, in flush\r\n start_line, self._headers, chunk, callback=callback)\r\n File \"tornado/http1connection.py\", line 400, in write_headers\r\n self._pending_write = self.stream.write(data)\r\n File \"tornado/iostream.py\", line 406, in write\r\n self._handle_write()\r\n File \"tornado/iostream.py\", line 872, in _handle_write\r\n del self._write_buffer[:self._write_buffer_pos]\r\n```\r\n\r\n## Environment\r\n\r\nOur application runs inside a Docker container. We use:\r\n* Python 3.6.1\r\n* `tornado` 4.5.1\r\n* `stackimpact` 1.0.0\r\n\r\nWe start it like this (simplified for brevity):\r\n```python\r\nimport asyncio\r\n\r\nfrom tornado.platform.asyncio import AsyncIOMainLoop\r\nfrom tornado.httpserver import HTTPServer\r\nfrom tornado.web import Application\r\n\r\n\r\nif __name__ == '__main__':\r\n AsyncIOMainLoop().install()\r\n loop = asyncio.get_event_loop()\r\n\r\n app = Application(...)\r\n server = HTTPServer(app)\r\n server.listen(8080)\r\n\r\n internal_app = Application(...)\r\n internal_server = HTTPServer(app)\r\n internal_server.listen(8081)\r\n\r\n loop.run_forever()\r\n```\r\n\r\n## Notes\r\n\r\nCursory googling turned up the same error happening in the same place, as reported in [this comment](https://github.com/tornadoweb/tornado/pull/2008#issuecomment-297975575) on a Tornado pull request. I don't know enough about Tornado's internals to guess at what's going on here but maybe @bdarnell can provide more insight.\r\n\r\nIn any case, I'm happy to provide more details as needed.","author":{"url":"https://github.com/adamrothman","@type":"Person","name":"adamrothman"},"datePublished":"2017-06-28T06:01:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/1/stackimpact-python/issues/1"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1bb33285-5ef0-84e9-21b5-4df7e657cad8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B5F4:2549A8:E9EF79:1472220:697B5F25 |
| html-safe-nonce | feea3b6e5d4cbda188508461278de54ac99ff3b4e1f2b050d680ce35541bef8d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUY0OjI1NDlBODpFOUVGNzk6MTQ3MjIyMDo2OTdCNUYyNSIsInZpc2l0b3JfaWQiOiIxNzA1MjQyOTEwMzg4ODcwOTQ5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | beea9bd0ea8a14755633ea3c919abc6b14e17878aa2828ce73d0b3a8f8285d2b |
| hovercard-subject-tag | issue:239060732 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/stackimpact/stackimpact-python/1/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ebf203f1e0071212b5bf305c5a919384a10a199b574db5555bb212f67ede4dc0/stackimpact/stackimpact-python/issues/1 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ebf203f1e0071212b5bf305c5a919384a10a199b574db5555bb212f67ede4dc0/stackimpact/stackimpact-python/issues/1 |
| og:image:alt | Problem Since adding the StackImpact agent to a Tornado/asyncio application, we started seeing BufferErrors like this: BufferError: Existing exports of data: object cannot be re-sized File "tornado... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | adamrothman |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7eed3e20c41f6c464df945b1f353a52c450ca1653f4697d4ebcc58c2adc5868a |
| turbo-cache-control | no-preview |
| go-import | github.com/stackimpact/stackimpact-python git https://github.com/stackimpact/stackimpact-python.git |
| octolytics-dimension-user_id | 22001993 |
| octolytics-dimension-user_login | stackimpact |
| octolytics-dimension-repository_id | 95447826 |
| octolytics-dimension-repository_nwo | stackimpact/stackimpact-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 95447826 |
| octolytics-dimension-repository_network_root_nwo | stackimpact/stackimpact-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d72d3188f34dc5c9b58eb1a406c45898c7a25009 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width