{"action":"created","issue":{"url":"https://api.github.com/repos/LMAX-Exchange/disruptor/issues/122","labels_url":"https://api.github.com/repos/LMAX-Exchange/disruptor/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/LMAX-Exchange/disruptor/issues/122/comments","events_url":"https://api.github.com/repos/LMAX-Exchange/disruptor/issues/122/events","html_url":"https://github.com/LMAX-Exchange/disruptor/issues/122","id":105031244,"number":122,"title":"ExceptionHandler isn't propagated by Disruptor to existed WorkerPool after set","user":{"login":"Spikhalskiy","id":532108,"avatar_url":"https://avatars.githubusercontent.com/u/532108?v=3","gravatar_id":"","url":"https://api.github.com/users/Spikhalskiy","html_url":"https://github.com/Spikhalskiy","followers_url":"https://api.github.com/users/Spikhalskiy/followers","following_url":"https://api.github.com/users/Spikhalskiy/following{/other_user}","gists_url":"https://api.github.com/users/Spikhalskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/Spikhalskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spikhalskiy/subscriptions","organizations_url":"https://api.github.com/users/Spikhalskiy/orgs","repos_url":"https://api.github.com/users/Spikhalskiy/repos","events_url":"https://api.github.com/users/Spikhalskiy/events{/privacy}","received_events_url":"https://api.github.com/users/Spikhalskiy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"ajsutton","id":72675,"avatar_url":"https://avatars.githubusercontent.com/u/72675?v=3","gravatar_id":"","url":"https://api.github.com/users/ajsutton","html_url":"https://github.com/ajsutton","followers_url":"https://api.github.com/users/ajsutton/followers","following_url":"https://api.github.com/users/ajsutton/following{/other_user}","gists_url":"https://api.github.com/users/ajsutton/gists{/gist_id}","starred_url":"https://api.github.com/users/ajsutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajsutton/subscriptions","organizations_url":"https://api.github.com/users/ajsutton/orgs","repos_url":"https://api.github.com/users/ajsutton/repos","events_url":"https://api.github.com/users/ajsutton/events{/privacy}","received_events_url":"https://api.github.com/users/ajsutton/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2015-09-05T15:02:14Z","updated_at":"2015-09-07T00:53:19Z","closed_at":null,"body":"ExceptionHandlers set to Disruptor after initializing WorkerPool will not be propagated to WorkerPool\r\n\r\n```\r\ndisruptor = new Disruptor<>(Event::new, RING_SIZE, executor, ProducerType.SINGLE, new BlockingWaitStrategy());\r\n\r\ndisruptor.handleExceptionsWith(new FatalExceptionHandler());\r\ndisruptor.handleEventsWith(new Handler<Event>()).handleEventsWithWorkerPool(new AnotherHandler<Event>(), new AnotherHandler<Event>());\r\n```\r\n\r\nWill fail with NullPointer exception in case of exception in AnotherHandler (exception handler in WorkerPool is null), while on this code\r\n\r\n```\r\ndisruptor = new Disruptor<>(Event::new, RING_SIZE, executor, ProducerType.SINGLE, new BlockingWaitStrategy());\r\n\r\ndisruptor.handleEventsWith(new Handler<Event>()).handleEventsWithWorkerPool(new AnotherHandler<Event>(), new AnotherHandler<Event>());\r\ndisruptor.handleExceptionsWith(new FatalExceptionHandler());\r\n```\r\n\r\nwill handle exception correctly.\r\nI think this code samples should lead to the same result and state.\r\n"},"comment":{"url":"https://api.github.com/repos/LMAX-Exchange/disruptor/issues/comments/138146703","html_url":"https://github.com/LMAX-Exchange/disruptor/issues/122#issuecomment-138146703","issue_url":"https://api.github.com/repos/LMAX-Exchange/disruptor/issues/122","id":138146703,"user":{"login":"ajsutton","id":72675,"avatar_url":"https://avatars.githubusercontent.com/u/72675?v=3","gravatar_id":"","url":"https://api.github.com/users/ajsutton","html_url":"https://github.com/ajsutton","followers_url":"https://api.github.com/users/ajsutton/followers","following_url":"https://api.github.com/users/ajsutton/following{/other_user}","gists_url":"https://api.github.com/users/ajsutton/gists{/gist_id}","starred_url":"https://api.github.com/users/ajsutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajsutton/subscriptions","organizations_url":"https://api.github.com/users/ajsutton/orgs","repos_url":"https://api.github.com/users/ajsutton/repos","events_url":"https://api.github.com/users/ajsutton/events{/privacy}","received_events_url":"https://api.github.com/users/ajsutton/received_events","type":"User","site_admin":false},"created_at":"2015-09-07T00:53:19Z","updated_at":"2015-09-07T00:53:19Z","body":"ok, so sounds like the way forward then is to have the Disruptor class always set a wrapper as the exceptionHandler so we can change the actual implementation after creation.  I'd suggest we do that with a new method setDefaultExceptionHandler and deprecate the current handleExceptionsWith. That way people knowingly switch over to the new behaviour.\r\n\r\nMy inclination is to only allow setDefaultExceptionHandler to be called prior to start() - the same as handleEventsWith etc.  Technically we could alert each sequence to get the change to be picked up by a running processor but I think that probably falls into the \"handle exceptions yourself\" case."}}