{"action":"created","issue":{"url":"https://api.github.com/repos/phusion/passenger/issues/1659","labels_url":"https://api.github.com/repos/phusion/passenger/issues/1659/labels{/name}","comments_url":"https://api.github.com/repos/phusion/passenger/issues/1659/comments","events_url":"https://api.github.com/repos/phusion/passenger/issues/1659/events","html_url":"https://github.com/phusion/passenger/issues/1659","id":114852310,"number":1659,"title":"Premature Union Station log transaction close due to client connection loss","user":{"login":"OnixGH","id":10709325,"avatar_url":"https://avatars.githubusercontent.com/u/10709325?v=3","gravatar_id":"","url":"https://api.github.com/users/OnixGH","html_url":"https://github.com/OnixGH","followers_url":"https://api.github.com/users/OnixGH/followers","following_url":"https://api.github.com/users/OnixGH/following{/other_user}","gists_url":"https://api.github.com/users/OnixGH/gists{/gist_id}","starred_url":"https://api.github.com/users/OnixGH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OnixGH/subscriptions","organizations_url":"https://api.github.com/users/OnixGH/orgs","repos_url":"https://api.github.com/users/OnixGH/repos","events_url":"https://api.github.com/users/OnixGH/events{/privacy}","received_events_url":"https://api.github.com/users/OnixGH/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phusion/passenger/labels/Priority/High","name":"Priority/High","color":"eb6420"},{"url":"https://api.github.com/repos/phusion/passenger/labels/UnionStation","name":"UnionStation","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/phusion/passenger/milestones/40","html_url":"https://github.com/phusion/passenger/milestones/5.0.22","labels_url":"https://api.github.com/repos/phusion/passenger/milestones/40/labels","id":1297611,"number":40,"title":"5.0.22","description":"","creator":{"login":"FooBarWidget","id":819,"avatar_url":"https://avatars.githubusercontent.com/u/819?v=3","gravatar_id":"","url":"https://api.github.com/users/FooBarWidget","html_url":"https://github.com/FooBarWidget","followers_url":"https://api.github.com/users/FooBarWidget/followers","following_url":"https://api.github.com/users/FooBarWidget/following{/other_user}","gists_url":"https://api.github.com/users/FooBarWidget/gists{/gist_id}","starred_url":"https://api.github.com/users/FooBarWidget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FooBarWidget/subscriptions","organizations_url":"https://api.github.com/users/FooBarWidget/orgs","repos_url":"https://api.github.com/users/FooBarWidget/repos","events_url":"https://api.github.com/users/FooBarWidget/events{/privacy}","received_events_url":"https://api.github.com/users/FooBarWidget/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":11,"state":"open","created_at":"2015-09-09T12:35:54Z","updated_at":"2015-11-23T10:04:02Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-11-03T16:19:26Z","updated_at":"2015-11-23T11:26:33Z","closed_at":null,"body":"If Passenger detects a client connection drop, it will also disconnect / ignore the app response. At that moment the application instrumentation is usually still busy writing to the request log transaction, but because the core releases its log reference (DETACH), the ustrouter will transmit the not-yet-completed transaction.\r\n\r\nThis means that Union Station log entries for clients requests that disconnected prematurely will also be missing an undefined amount of entries from the instrumented app and provide an incomplete picture of resources used (e.g. if a client does requests that cause long DB queries, but keeps dropping the connection then the DB queries will be \"hidden\" from the logs even though they were executed).\r\n\r\nPassenger can solve this by deferring request finalization until at least one byte of application response has been read."},"comment":{"url":"https://api.github.com/repos/phusion/passenger/issues/comments/158909356","html_url":"https://github.com/phusion/passenger/issues/1659#issuecomment-158909356","issue_url":"https://api.github.com/repos/phusion/passenger/issues/1659","id":158909356,"user":{"login":"OnixGH","id":10709325,"avatar_url":"https://avatars.githubusercontent.com/u/10709325?v=3","gravatar_id":"","url":"https://api.github.com/users/OnixGH","html_url":"https://github.com/OnixGH","followers_url":"https://api.github.com/users/OnixGH/followers","following_url":"https://api.github.com/users/OnixGH/following{/other_user}","gists_url":"https://api.github.com/users/OnixGH/gists{/gist_id}","starred_url":"https://api.github.com/users/OnixGH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OnixGH/subscriptions","organizations_url":"https://api.github.com/users/OnixGH/orgs","repos_url":"https://api.github.com/users/OnixGH/repos","events_url":"https://api.github.com/users/OnixGH/events{/privacy}","received_events_url":"https://api.github.com/users/OnixGH/received_events","type":"User","site_admin":false},"created_at":"2015-11-23T11:26:33Z","updated_at":"2015-11-23T11:26:33Z","body":"A likely cause for the difference with the UST gateway log is timestamp-based reordering. Not sure why it would be done before transmitting to the UST gateway but not for the devmode sink. We just discussed removing the timestamps however, and that would break the \"autorepair\" here too. We should fix the root cause."}}