> On May 17, 2016, 2:51 a.m., George Sirois wrote: > > src/main/java/org/apache/aurora/scheduler/events/Webhook.java, line 86 > > <https://reviews.apache.org/r/47440/diff/1/?file=1385132#file1385132line86> > > > > Should this be dispatched on another thread or added to a queue for > > future delivery? AFAICT the distribution of events is synchronous, so it > > seems like operations that might block for any significant amount of time > > could cause issues. > > Dmitriy Shirchenko wrote: > Yea, I'm not sure. Do you have examples of best practices on how to > dispatch to another thread? > > Dmitriy Shirchenko wrote: > I looked at the logs, and looks like each event is sent via own process > judging by logs. > > Do you think this is correct or I'm off base? > ``` > I0517 06:28:28.250 [AsyncProcessor-6, Webhook:57] Sending message > {"task":{"cachedHashCode":0,"assignedTask":{"cachedHashCode":0,"taskId":"vagrant-test-http_e > I0517 06:28:28.254 [AsyncProcessor-6, Webhook:77] Disconnecting > I0517 06:28:28.256 [AsyncProcessor-6, Webhook:80] Done with call > <snip> > I0517 06:28:28.808 [AsyncProcessor-4, Webhook:57] Sending message > {"task":{"cachedHashCode":0,"assignedTask":{"cachedHashCode":0,"taskId":"vagrant-test-http_e > > xample-0-81ba7ce9-1900-4177-98af-847ae3a90fb7","slaveId":"8639d42c-2c68-40d9-9131-43e597457de5-S0","slaveHost":"192.168.33.7","task":{"cachedHashCode":-528474 > <snip> > I0517 06:28:28.810 [AsyncProcessor-4, Webhook:77] Disconnecting > I0517 06:28:28.810 [AsyncProcessor-4, Webhook:80] Done with call > ```
We use AsyncEventBus with the thread pool size of 8: https://github.com/apache/aurora/blob/b24619b28c4dbb35188871bacd0091a9e01218e3/src/main/java/org/apache/aurora/scheduler/async/AsyncModule.java#L63 It should be ok to call on an event bus thread as long as connection timeouts are set aggresively (see Stephan's suggestion below). - Maxim ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/47440/#review133482 ----------------------------------------------------------- On May 17, 2016, 6:44 a.m., Dmitriy Shirchenko wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/47440/ > ----------------------------------------------------------- > > (Updated May 17, 2016, 6:44 a.m.) > > > Review request for Aurora. > > > Bugs: AURORA-1683 > https://issues.apache.org/jira/browse/AURORA-1683 > > > Repository: aurora > > > Description > ------- > > Looking for some feedback whether I'm on the correct path in adding a > webhook. All comments are welcome! > > > Diffs > ----- > > docs/reference/scheduler-configuration.md > f7d676d0ed6bc536f4341dbb9365cf50e8607efb > examples/vagrant/upstart/aurora-scheduler.conf > 3d9e706de564df5e24cb34265bebc0db1cad11a0 > src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java > 9ebfe230836e88a97bc60092373f72f176a8f6f2 > src/main/java/org/apache/aurora/scheduler/events/PubsubEvent.java > 2a4c0665e48d30e0655de00bd7f6f9b49f01eafc > src/main/java/org/apache/aurora/scheduler/events/Webhook.java PRE-CREATION > src/main/java/org/apache/aurora/scheduler/events/WebhookInfo.java > PRE-CREATION > src/main/java/org/apache/aurora/scheduler/events/WebhookModule.java > PRE-CREATION > src/main/resources/org/apache/aurora/scheduler/webhook.json PRE-CREATION > src/test/java/org/apache/aurora/scheduler/events/WebhookTest.java > PRE-CREATION > > Diff: https://reviews.apache.org/r/47440/diff/ > > > Testing > ------- > > Need to fix tests. > > > Thanks, > > Dmitriy Shirchenko > >
