{"action":"created","issue":{"url":"https://api.github.com/repos/resilience4j/resilience4j/issues/278","repository_url":"https://api.github.com/repos/resilience4j/resilience4j","labels_url":"https://api.github.com/repos/resilience4j/resilience4j/issues/278/labels{/name}","comments_url":"https://api.github.com/repos/resilience4j/resilience4j/issues/278/comments","events_url":"https://api.github.com/repos/resilience4j/resilience4j/issues/278/events","html_url":"https://github.com/resilience4j/resilience4j/issues/278","id":371802250,"node_id":"MDU6SXNzdWUzNzE4MDIyNTA=","number":278,"title":"Reactor CircuitBreakerOperator doesn't play nice with Mono.timeout","user":{"login":"kennymacleod","id":6092156,"node_id":"MDQ6VXNlcjYwOTIxNTY=","avatar_url":"https://avatars1.githubusercontent.com/u/6092156?v=4","gravatar_id":"","url":"https://api.github.com/users/kennymacleod","html_url":"https://github.com/kennymacleod","followers_url":"https://api.github.com/users/kennymacleod/followers","following_url":"https://api.github.com/users/kennymacleod/following{/other_user}","gists_url":"https://api.github.com/users/kennymacleod/gists{/gist_id}","starred_url":"https://api.github.com/users/kennymacleod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennymacleod/subscriptions","organizations_url":"https://api.github.com/users/kennymacleod/orgs","repos_url":"https://api.github.com/users/kennymacleod/repos","events_url":"https://api.github.com/users/kennymacleod/events{/privacy}","received_events_url":"https://api.github.com/users/kennymacleod/received_events","type":"User","site_admin":false},"labels":[{"id":1071803914,"node_id":"MDU6TGFiZWwxMDcxODAzOTE0","url":"https://api.github.com/repos/resilience4j/resilience4j/labels/needs%20investigation","name":"needs investigation","color":"17167a","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-19T04:24:04Z","updated_at":"2018-10-24T03:53:47Z","closed_at":null,"author_association":"NONE","body":"I have the following unit test which combines the `Mono.timeout` operator with a `CircuitBreakerOperator`:\r\n\r\n    @Test\r\n    public void circuitBreaker() throws Exception {\r\n        final CircuitBreaker circuitBreaker = CircuitBreaker.ofDefaults(\"foo\");\r\n\r\n        while (true) {\r\n            StepVerifier.create(Mono.error(new MyException(\"foo\"))\r\n                            .timeout(Duration.ofMillis(5))\r\n                            .transform(CircuitBreakerOperator.of(circuitBreaker)))\r\n                    .thenAwait()\r\n                    .expectError(MyException.class)\r\n                    .verify();\r\n        }\r\n    }\r\n\r\nThis spins in an infinite loop, creating a erroring `Mono` with a timeout and circuit breaker, and asserts that `MyException` is emitted from the decorated `Mono`, until such a time as the circuit breaker pops, upon which the test should (and does) fail.\r\n\r\nHowever, the test should fail because the emitted error is a `CircuitBreakerOpenException`, but it fails with `BubblingException` instead. Crucially, if I remove the `timeout` operator, it works as expected, i.e. it emits a `CircuitBreakerOpenException`.\r\n\r\nThe timeout operator shouldn't make any difference here, since the `Mono` always emits its error immediately."},"comment":{"url":"https://api.github.com/repos/resilience4j/resilience4j/issues/comments/432503526","html_url":"https://github.com/resilience4j/resilience4j/issues/278#issuecomment-432503526","issue_url":"https://api.github.com/repos/resilience4j/resilience4j/issues/278","id":432503526,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjUwMzUyNg==","user":{"login":"storozhukBM","id":3532750,"node_id":"MDQ6VXNlcjM1MzI3NTA=","avatar_url":"https://avatars3.githubusercontent.com/u/3532750?v=4","gravatar_id":"","url":"https://api.github.com/users/storozhukBM","html_url":"https://github.com/storozhukBM","followers_url":"https://api.github.com/users/storozhukBM/followers","following_url":"https://api.github.com/users/storozhukBM/following{/other_user}","gists_url":"https://api.github.com/users/storozhukBM/gists{/gist_id}","starred_url":"https://api.github.com/users/storozhukBM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storozhukBM/subscriptions","organizations_url":"https://api.github.com/users/storozhukBM/orgs","repos_url":"https://api.github.com/users/storozhukBM/repos","events_url":"https://api.github.com/users/storozhukBM/events{/privacy}","received_events_url":"https://api.github.com/users/storozhukBM/received_events","type":"User","site_admin":false},"created_at":"2018-10-24T03:53:47Z","updated_at":"2018-10-24T03:53:47Z","author_association":"MEMBER","body":"Hi @kennymacleod , \r\nYep, it looks like unexpected behaviour for me. Maybe @madgnome can make a quick comment on this. Otherwise I'll investigate this issue a little bit later."}}
{"actor":{"display_login":"storozhukBM"}}