Re: Felix and Pax Logging

2017-11-29 Thread Milen Dyankov
I think in order to do that you need FileInstall (
http://felix.apache.org/documentation/subprojects/apache-felix-file-install.html).
You need to configure it to watch the folder(s) you want via system
property `felix.fileinstall.dir`.
Then you can place a file `org.ops4j.pax.logging.cfg` in that folder and it
should (re)configure Pax Logging.

On Wed, Nov 29, 2017 at 5:42 PM, daniel stieger 
wrote:

>
> Gentlemen,
>
> i feel realy bad to ask such a beginner s question, but after 4 hours i m
> giving up.
>
> I just use a plain felix installation and added the config admin and the
> pax logging framework (api + service). However, i have not found out how to
> configure pax logging to use a file...
>
> * placed org.ops4j.pax.logging.properties   file to ./confg
> * placed org.ops4j.pax.logging.cfgfile to ./bundle
>
> and to almost all other dirs ..  .. i was able to
> set org.ops4j.pax.logging.DefaultServiceLog.level=ERROR
> int ./config/config.propeties That did work! also tried to adjust with
> "org.ops4j.pax.logging.log4j.rootLogger = " in this very file ..
> doesn't work either.
>
> How could i adjust the pax settings? Is there also a way to check those
> settings via gogo shell?
>
>
> Any hint apreciated ..
> Daniel
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>


-- 
http://about.me/milen


Re: Felix and Pax Logging

2017-11-29 Thread Erwin Hogeweg
Daniel,

We have these in our startup script:
-Dfelix.fileinstall.dir=../../conf \
-Dlog4j.configuration=file:../../conf/org.ops4j.pax.logging.cfg \

Not even sure anymore if we need them both, but it works perfectly.

Hope this helps,

Erwin

On Nov 29, 2017, at 11:42, daniel stieger 
> wrote:


Gentlemen,

i feel realy bad to ask such a beginner s question, but after 4 hours i m 
giving up.

I just use a plain felix installation and added the config admin and the pax 
logging framework (api + service). However, i have not found out how to 
configure pax logging to use a file...

* placed org.ops4j.pax.logging.properties   file to ./confg
* placed org.ops4j.pax.logging.cfgfile to ./bundle

and to almost all other dirs ..  .. i was able to set 
org.ops4j.pax.logging.DefaultServiceLog.level=ERROR
int ./config/config.propeties That did work! also tried to adjust with
"org.ops4j.pax.logging.log4j.rootLogger = " in this very file .. 
doesn't work either.

How could i adjust the pax settings? Is there also a way to check those 
settings via gogo shell?


Any hint apreciated ..
Daniel


-
To unsubscribe, e-mail: 
users-unsubscr...@felix.apache.org
For additional commands, e-mail: 
users-h...@felix.apache.org


Erwin Hogeweg
CTO
3690 Airport Road
Boca Raton, FL 33431
P. +1 (954) 556-6565
M. +1 (561) 306-7395
F. +1 (561) 948-2730
[Seecago]


Felix and Pax Logging

2017-11-29 Thread daniel stieger

Gentlemen,
 
i feel realy bad to ask such a beginner s question, but after 4 hours i m 
giving up. 
 
I just use a plain felix installation and added the config admin and the pax 
logging framework (api + service). However, i have not found out how to 
configure pax logging to use a file... 
 
* placed org.ops4j.pax.logging.properties   file to ./confg
* placed org.ops4j.pax.logging.cfg            file to ./bundle 
 
and to almost all other dirs ..  .. i was able to set 
org.ops4j.pax.logging.DefaultServiceLog.level=ERROR   
int ./config/config.propeties That did work! also tried to adjust with 
"org.ops4j.pax.logging.log4j.rootLogger =     " in this very file .. 
doesn't work either. 
 
How could i adjust the pax settings? Is there also a way to check those 
settings via gogo shell?
 
 
Any hint apreciated .. 
Daniel
 

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Is EventAdmin-1.4.6 really loosing events?

2017-11-29 Thread Erwin Hogeweg
Carsten,

Ugh… good point.

Well, case closed I guess? :-)

Thanks for your help Carsten.


Erwin


> On Nov 29, 2017, at 10:02, Carsten Ziegeler  wrote:
>
> Hi,
>
> actually I think this is more or less ok. The events are posted from the
> same thread and event admin requires them to be delivered in the order
> they are posted. So if one listener is blocking, then delivery of all
> other events initiated from the same thread are blocked.
>
> Regards
>
> Carsten
>
>
> Carsten Ziegeler wrote
>> Hi Erwin,
>>
>> ah sorry, right :) I was reading modulo 10 instead of equals 10...
>>
>> Yes, you're absolutely right in this case, that should not happen.
>>
>> This looks like a problem in postEvent somewhere
>>
>> Carsten
>>
>>
>> Erwin Hogeweg wrote
>>> Hi Carsten,
>>>
>>> Sorry, I think didn’t make myself clear.
>>>
>>> I am only replacing ONE listener with a BlockingListener, and then I am 
>>> blocking ONE event delivery. So I do expect to loose ONE event, not 70k…
>>>
>>> Or am I missing something?
>>>
>>> Erwin
>>>
>>>
>>>@Test
>>>public void testEventing() throws Exception {
>>>// this.addListener(PREFIX + "/0", null);
>>>this.addBlockingListener(PREFIX + "/0", null);
>>>this.addListener(PREFIX + "/1", null);
>>>this.addListener(PREFIX + "/2", null);
>>> ...
>>>
>>>
>>>
>>> On Nov 29, 2017, at 09:21, Carsten Ziegeler 
>>> > wrote:
>>>
>>> Thanks
>>>
>>> I'm not sure if event admin could/should do anything in this case. Each
>>> blocking listener takes away one thread from the thread pool. As soon as
>>> you have as many blocking listeners as the pool has threads, event admin
>>> will not deliver any event anymore
>>>
>>> Regards
>>>
>>> Carsten
>>>
>>>
>>> Erwin Hogeweg wrote
>>> Hi Carsten,
>>>
>>> After analyzing a bunch of log files we found some evidence that suggested 
>>> that an EventAdminThread might be blocked.
>>>
>>> I was able to duplicate it with a JUnit test. I created a BlockingListener 
>>> with extends Listener and override the handleEvent() method. As you can see 
>>> below we are loosing almost 7 events because of this one block.
>>>
>>> I know, eventHandlers are not supposed to block, so we definitely have a 
>>> design issue here, but I figured I share the results with you because I am 
>>> not sure this is what’s expected.
>>>
>>>
>>> Kind Regards,
>>>
>>> Erwin
>>>
>>>
>>> @Override
>>> public void handleEvent(final Event event) {
>>> this.test.handleEvent(event, this.payload);
>>> count++;
>>> if (count == 10) {
>>> logger.info("{} is blocking forever", 
>>> Thread.currentThread().getName());
>>> while (true) {
>>> try {
>>> Thread.sleep(6);
>>> } catch (InterruptedException e) {
>>> //
>>> }
>>> }
>>> }
>>>
>>> }
>>>
>>>
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Starting eventing test 
>>> StressTestIT
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Preparing test with 15 
>>> threads and 1 events per thread.
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Expecting 105 
>>> events.
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started test with 15 
>>> threads and 1 events.
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 0 events so 
>>> far.
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 0 events so 
>>> far.
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : 
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>>> Started thread
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : 
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : 
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>>> [org.apache.felix.eventadmin.ittests.StressTestITStarted thread
>>> Started thread
>>> ] : Started thread
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 12 events so 
>>> far.
>>> [org.apache.felix.eventadmin.ittests.BlockingListener] : EventAdminThread 
>>> #6 is blocking forever
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
>>> [org.apache.felix.eventadmin.ittests.StressTestIT] 

Re: Is EventAdmin-1.4.6 really loosing events?

2017-11-29 Thread Carsten Ziegeler
Hi,

actually I think this is more or less ok. The events are posted from the
same thread and event admin requires them to be delivered in the order
they are posted. So if one listener is blocking, then delivery of all
other events initiated from the same thread are blocked.

Regards

Carsten


Carsten Ziegeler wrote
> Hi Erwin,
> 
> ah sorry, right :) I was reading modulo 10 instead of equals 10...
> 
> Yes, you're absolutely right in this case, that should not happen.
> 
> This looks like a problem in postEvent somewhere
> 
> Carsten
> 
> 
> Erwin Hogeweg wrote
>> Hi Carsten,
>>
>> Sorry, I think didn’t make myself clear.
>>
>> I am only replacing ONE listener with a BlockingListener, and then I am 
>> blocking ONE event delivery. So I do expect to loose ONE event, not 70k…
>>
>> Or am I missing something?
>>
>> Erwin
>>
>>
>> @Test
>> public void testEventing() throws Exception {
>> // this.addListener(PREFIX + "/0", null);
>> this.addBlockingListener(PREFIX + "/0", null);
>> this.addListener(PREFIX + "/1", null);
>> this.addListener(PREFIX + "/2", null);
>> ...
>>
>>
>>
>> On Nov 29, 2017, at 09:21, Carsten Ziegeler 
>> > wrote:
>>
>> Thanks
>>
>> I'm not sure if event admin could/should do anything in this case. Each
>> blocking listener takes away one thread from the thread pool. As soon as
>> you have as many blocking listeners as the pool has threads, event admin
>> will not deliver any event anymore
>>
>> Regards
>>
>> Carsten
>>
>>
>> Erwin Hogeweg wrote
>> Hi Carsten,
>>
>> After analyzing a bunch of log files we found some evidence that suggested 
>> that an EventAdminThread might be blocked.
>>
>> I was able to duplicate it with a JUnit test. I created a BlockingListener 
>> with extends Listener and override the handleEvent() method. As you can see 
>> below we are loosing almost 7 events because of this one block.
>>
>> I know, eventHandlers are not supposed to block, so we definitely have a 
>> design issue here, but I figured I share the results with you because I am 
>> not sure this is what’s expected.
>>
>>
>> Kind Regards,
>>
>> Erwin
>>
>>
>> @Override
>> public void handleEvent(final Event event) {
>> this.test.handleEvent(event, this.payload);
>> count++;
>> if (count == 10) {
>> logger.info("{} is blocking forever", 
>> Thread.currentThread().getName());
>> while (true) {
>> try {
>> Thread.sleep(6);
>> } catch (InterruptedException e) {
>> //
>> }
>> }
>> }
>>
>> }
>>
>>
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Starting eventing test 
>> StressTestIT
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Preparing test with 15 
>> threads and 1 events per thread.
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Expecting 105 
>> events.
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started test with 15 
>> threads and 1 events.
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 0 events so 
>> far.
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 0 events so 
>> far.
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : 
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>> Started thread
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : 
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : 
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>> [org.apache.felix.eventadmin.ittests.StressTestITStarted thread
>> Started thread
>> ] : Started thread
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 12 events so 
>> far.
>> [org.apache.felix.eventadmin.ittests.BlockingListener] : EventAdminThread #6 
>> is blocking forever
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
>> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 

Re: Is EventAdmin-1.4.6 really loosing events?

2017-11-29 Thread Carsten Ziegeler
Hi Erwin,

ah sorry, right :) I was reading modulo 10 instead of equals 10...

Yes, you're absolutely right in this case, that should not happen.

This looks like a problem in postEvent somewhere

Carsten


Erwin Hogeweg wrote
> Hi Carsten,
> 
> Sorry, I think didn’t make myself clear.
> 
> I am only replacing ONE listener with a BlockingListener, and then I am 
> blocking ONE event delivery. So I do expect to loose ONE event, not 70k…
> 
> Or am I missing something?
> 
> Erwin
> 
> 
> @Test
> public void testEventing() throws Exception {
> // this.addListener(PREFIX + "/0", null);
> this.addBlockingListener(PREFIX + "/0", null);
> this.addListener(PREFIX + "/1", null);
> this.addListener(PREFIX + "/2", null);
> ...
> 
> 
> 
> On Nov 29, 2017, at 09:21, Carsten Ziegeler 
> > wrote:
> 
> Thanks
> 
> I'm not sure if event admin could/should do anything in this case. Each
> blocking listener takes away one thread from the thread pool. As soon as
> you have as many blocking listeners as the pool has threads, event admin
> will not deliver any event anymore
> 
> Regards
> 
> Carsten
> 
> 
> Erwin Hogeweg wrote
> Hi Carsten,
> 
> After analyzing a bunch of log files we found some evidence that suggested 
> that an EventAdminThread might be blocked.
> 
> I was able to duplicate it with a JUnit test. I created a BlockingListener 
> with extends Listener and override the handleEvent() method. As you can see 
> below we are loosing almost 7 events because of this one block.
> 
> I know, eventHandlers are not supposed to block, so we definitely have a 
> design issue here, but I figured I share the results with you because I am 
> not sure this is what’s expected.
> 
> 
> Kind Regards,
> 
> Erwin
> 
> 
> @Override
> public void handleEvent(final Event event) {
> this.test.handleEvent(event, this.payload);
> count++;
> if (count == 10) {
> logger.info("{} is blocking forever", 
> Thread.currentThread().getName());
> while (true) {
> try {
> Thread.sleep(6);
> } catch (InterruptedException e) {
> //
> }
> }
> }
> 
> }
> 
> 
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Starting eventing test 
> StressTestIT
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Preparing test with 15 
> threads and 1 events per thread.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Expecting 105 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started test with 15 
> threads and 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 0 events so far.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 0 events so far.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : 
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : 
> [org.apache.felix.eventadmin.ittests.StressTestIT] : 
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestITStarted thread
> Started thread
> ] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 12 events so 
> far.
> [org.apache.felix.eventadmin.ittests.BlockingListener] : EventAdminThread #6 
> is blocking forever
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 

Re: Is EventAdmin-1.4.6 really loosing events?

2017-11-29 Thread Erwin Hogeweg
Hi Carsten,

Sorry, I think didn’t make myself clear.

I am only replacing ONE listener with a BlockingListener, and then I am 
blocking ONE event delivery. So I do expect to loose ONE event, not 70k…

Or am I missing something?

Erwin


@Test
public void testEventing() throws Exception {
// this.addListener(PREFIX + "/0", null);
this.addBlockingListener(PREFIX + "/0", null);
this.addListener(PREFIX + "/1", null);
this.addListener(PREFIX + "/2", null);
...



On Nov 29, 2017, at 09:21, Carsten Ziegeler 
> wrote:

Thanks

I'm not sure if event admin could/should do anything in this case. Each
blocking listener takes away one thread from the thread pool. As soon as
you have as many blocking listeners as the pool has threads, event admin
will not deliver any event anymore

Regards

Carsten


Erwin Hogeweg wrote
Hi Carsten,

After analyzing a bunch of log files we found some evidence that suggested that 
an EventAdminThread might be blocked.

I was able to duplicate it with a JUnit test. I created a BlockingListener with 
extends Listener and override the handleEvent() method. As you can see below we 
are loosing almost 7 events because of this one block.

I know, eventHandlers are not supposed to block, so we definitely have a design 
issue here, but I figured I share the results with you because I am not sure 
this is what’s expected.


Kind Regards,

Erwin


@Override
public void handleEvent(final Event event) {
this.test.handleEvent(event, this.payload);
count++;
if (count == 10) {
logger.info("{} is blocking forever", 
Thread.currentThread().getName());
while (true) {
try {
Thread.sleep(6);
} catch (InterruptedException e) {
//
}
}
}

}


[org.apache.felix.eventadmin.ittests.StressTestIT] : Starting eventing test 
StressTestIT
[org.apache.felix.eventadmin.ittests.StressTestIT] : Preparing test with 15 
threads and 1 events per thread.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Expecting 105 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started test with 15 
threads and 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 0 events so far.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 0 events so far.
[org.apache.felix.eventadmin.ittests.StressTestIT] : 
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : 
[org.apache.felix.eventadmin.ittests.StressTestIT] : 
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestITStarted thread
Started thread
] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 12 events so far.
[org.apache.felix.eventadmin.ittests.BlockingListener] : EventAdminThread #6 is 
blocking forever
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events so 
far.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events so 
far.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events so 
far.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events so 
far.

Re: Is EventAdmin-1.4.6 really loosing events?

2017-11-29 Thread Carsten Ziegeler
Thanks

I'm not sure if event admin could/should do anything in this case. Each
blocking listener takes away one thread from the thread pool. As soon as
you have as many blocking listeners as the pool has threads, event admin
will not deliver any event anymore

Regards

Carsten


Erwin Hogeweg wrote
> Hi Carsten,
> 
> After analyzing a bunch of log files we found some evidence that suggested 
> that an EventAdminThread might be blocked.
> 
> I was able to duplicate it with a JUnit test. I created a BlockingListener 
> with extends Listener and override the handleEvent() method. As you can see 
> below we are loosing almost 7 events because of this one block.
> 
> I know, eventHandlers are not supposed to block, so we definitely have a 
> design issue here, but I figured I share the results with you because I am 
> not sure this is what’s expected.
> 
> 
> Kind Regards,
> 
> Erwin
> 
> 
> @Override
> public void handleEvent(final Event event) {
> this.test.handleEvent(event, this.payload);
> count++;
> if (count == 10) {
> logger.info("{} is blocking forever", Thread.currentThread().getName());
> while (true) {
> try {
> Thread.sleep(6);
> } catch (InterruptedException e) {
> //
> }
> }
> }
> 
> }
> 
> 
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Starting eventing test 
> StressTestIT
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Preparing test with 15 
> threads and 1 events per thread.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Expecting 105 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started test with 15 
> threads and 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 0 events so far.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 0 events so far.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : 
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : 
> [org.apache.felix.eventadmin.ittests.StressTestIT] : 
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestITStarted thread
> Started thread
> ] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 12 events so 
> far.
> [org.apache.felix.eventadmin.ittests.BlockingListener] : EventAdminThread #6 
> is blocking forever
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events 
> so far.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events 
> so far.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events 
> so far.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events 
> so far.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events 
> so far.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events 
> so far.
> [org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events 
> so far.
> …
> 
> 
> 
> On Nov 15, 2017, at 21:04, Carsten Ziegeler 
> > wrote:
> 
> Hi,
> 
> we haven't experienced anything like this so far and I wouldn't know if
> any better out of 

Re: Is EventAdmin-1.4.6 really loosing events?

2017-11-29 Thread Erwin Hogeweg
Hi Carsten,

After analyzing a bunch of log files we found some evidence that suggested that 
an EventAdminThread might be blocked.

I was able to duplicate it with a JUnit test. I created a BlockingListener with 
extends Listener and override the handleEvent() method. As you can see below we 
are loosing almost 7 events because of this one block.

I know, eventHandlers are not supposed to block, so we definitely have a design 
issue here, but I figured I share the results with you because I am not sure 
this is what’s expected.


Kind Regards,

Erwin


@Override
public void handleEvent(final Event event) {
this.test.handleEvent(event, this.payload);
count++;
if (count == 10) {
logger.info("{} is blocking forever", Thread.currentThread().getName());
while (true) {
try {
Thread.sleep(6);
} catch (InterruptedException e) {
//
}
}
}

}


[org.apache.felix.eventadmin.ittests.StressTestIT] : Starting eventing test 
StressTestIT
[org.apache.felix.eventadmin.ittests.StressTestIT] : Preparing test with 15 
threads and 1 events per thread.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Expecting 105 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started test with 15 
threads and 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 0 events so far.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 0 events so far.
[org.apache.felix.eventadmin.ittests.StressTestIT] : 
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : 
[org.apache.felix.eventadmin.ittests.StressTestIT] : 
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestITStarted thread
Started thread
] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Started thread
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 12 events so far.
[org.apache.felix.eventadmin.ittests.BlockingListener] : EventAdminThread #6 is 
blocking forever
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Send 1 events.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events so 
far.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events so 
far.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events so 
far.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events so 
far.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events so 
far.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events so 
far.
[org.apache.felix.eventadmin.ittests.StressTestIT] : Received 980007 events so 
far.
…



On Nov 15, 2017, at 21:04, Carsten Ziegeler 
> wrote:

Hi,

we haven't experienced anything like this so far and I wouldn't know if
any better out of the box way to trouble shoot. I guess the best would
be to add additional logging to event admin, so you can follow what's
happening inside event admin.

If it is somehow reproducible, then switching from postEvent to
sendEvent could also help in identifying whether there is a problem in
the postEvent handling (which is more complicated than sendEvent).

Regards

Carsten


Erwin Hogeweg wrote
Hi,

I have a really bizarre problem. It looks like the eventAdmin is intermittent 
but frequently loosing events. I find