{"action":"created","issue":{"url":"https://api.github.com/repos/akkadotnet/akka.net/issues/3329","repository_url":"https://api.github.com/repos/akkadotnet/akka.net","labels_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/3329/labels{/name}","comments_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/3329/comments","events_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/3329/events","html_url":"https://github.com/akkadotnet/akka.net/pull/3329","id":298177240,"number":3329,"title":"Ask/PipeTo improvements","user":{"login":"Horusiath","id":679705,"avatar_url":"https://avatars0.githubusercontent.com/u/679705?v=4","gravatar_id":"","url":"https://api.github.com/users/Horusiath","html_url":"https://github.com/Horusiath","followers_url":"https://api.github.com/users/Horusiath/followers","following_url":"https://api.github.com/users/Horusiath/following{/other_user}","gists_url":"https://api.github.com/users/Horusiath/gists{/gist_id}","starred_url":"https://api.github.com/users/Horusiath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Horusiath/subscriptions","organizations_url":"https://api.github.com/users/Horusiath/orgs","repos_url":"https://api.github.com/users/Horusiath/repos","events_url":"https://api.github.com/users/Horusiath/events{/privacy}","received_events_url":"https://api.github.com/users/Horusiath/received_events","type":"User","site_admin":false},"labels":[{"id":226970587,"url":"https://api.github.com/repos/akkadotnet/akka.net/labels/akka-actor","name":"akka-actor","color":"c7def8","default":false},{"id":237551441,"url":"https://api.github.com/repos/akkadotnet/akka.net/labels/needs%20review","name":"needs review","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-19T06:58:16Z","updated_at":"2018-02-20T20:20:04Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/akkadotnet/akka.net/pulls/3329","html_url":"https://github.com/akkadotnet/akka.net/pull/3329","diff_url":"https://github.com/akkadotnet/akka.net/pull/3329.diff","patch_url":"https://github.com/akkadotnet/akka.net/pull/3329.patch"},"body":"This PR introduces:\r\n\r\n1. Several tests in `PipeTo` over cancelled tasks to verify correct behavior: see #3320\r\n2. Similar tests for `Ask`.\r\n2. `IsCancelled` property in `Status.Failure` message - by default failures for cancelled task never have exceptions.\r\n3.  The biggest improvement is `Status.Failure` propagation inside `Ask<>` - previously if i.e. Ask was expecting a string but `Status.Failure` was returned, ask was failing with InvalidCastException. Original failure reason was lost. Now the exception wrapped by `Status.Failure` will be re-thrown with a stack trace from origin."},"comment":{"url":"https://api.github.com/repos/akkadotnet/akka.net/issues/comments/367106194","html_url":"https://github.com/akkadotnet/akka.net/pull/3329#issuecomment-367106194","issue_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/3329","id":367106194,"user":{"login":"Aaronontheweb","id":326939,"avatar_url":"https://avatars1.githubusercontent.com/u/326939?v=4","gravatar_id":"","url":"https://api.github.com/users/Aaronontheweb","html_url":"https://github.com/Aaronontheweb","followers_url":"https://api.github.com/users/Aaronontheweb/followers","following_url":"https://api.github.com/users/Aaronontheweb/following{/other_user}","gists_url":"https://api.github.com/users/Aaronontheweb/gists{/gist_id}","starred_url":"https://api.github.com/users/Aaronontheweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aaronontheweb/subscriptions","organizations_url":"https://api.github.com/users/Aaronontheweb/orgs","repos_url":"https://api.github.com/users/Aaronontheweb/repos","events_url":"https://api.github.com/users/Aaronontheweb/events{/privacy}","received_events_url":"https://api.github.com/users/Aaronontheweb/received_events","type":"User","site_admin":false},"created_at":"2018-02-20T20:20:04Z","updated_at":"2018-02-20T20:20:04Z","author_association":"OWNER","body":"I agree with most of what @Horusiath has summarized here. Definitely better to send SOMETHING back and cause the Ask to blow-up quickly rather than slowly. \"Fail fast\" et al.\r\n\r\n>In this PR, an exception inside Status.Failure is being unwrapped and captured before rethrown. I was thinking about putting that logic as a virtual method into Status.Failure itself - I know that messages should not contain this kind of logic, but this way we could override a Status.Failure with our own message to customize an error that would be thrown by Ask<> in case of failure\r\n\r\nThis sounds like a bottomless pit of small, subtle bugs accrued over time. The \"don't be cute\" rule applies here. Just keep the behavior simple and leave it up to the end-user to infer \"meaning\" from the underlying exception. As long as we pass some sort of exception into the `Status.Failure` upon cancellation, which is what this PR was originally trying to accomplish, that should be sufficient. Stuff a `TaskCancellationException` in there instead of letting it be null and call it a day IMHO."}}
{"actor":{"display_login":"Aaronontheweb"}}