osgi - Blocked threads due to ServiceRegistry -


i have relatively high volume/requests system in using osgi. close 800m requests per day.

we seeing issues threads getting blocked. every request comes in, forward event/data osgi bundle using registerservice pass payload/data osgi bundle listening service.

like this: bundlecontext.registerservice(map.class.getname(), dataholdermap, null);

where dataholdermap nothing regular java hashmap

here threaddump using jstack:

===========================================================================

"requestthread" prio=10 tid=0x00000000421ab800 nid=0x1042 runnable [0x00007fbdd3867000] java.lang.thread.state: runnable @ org.apache.felix.framework.serviceregistry.getservice(serviceregistry.java:295) - locked <0x0000000700e2c590> (a org.apache.felix.framework.serviceregistry) @ org.apache.felix.framework.felix.getservice(felix.java:3568) @ org.apache.felix.framework.bundlecontextimpl.getservice(bundlecontextimpl.java:468) @ org.osgi.util.tracker.servicetracker.addingservice(servicetracker.java:411) @ org.osgi.util.tracker.servicetracker$tracked.customizeradding(servicetracker.java:932) @ org.osgi.util.tracker.servicetracker$tracked.customizeradding(servicetracker.java:864) @ org.osgi.util.tracker.abstracttracked.trackadding(abstracttracked.java:256) @ org.osgi.util.tracker.abstracttracked.track(abstracttracked.java:229) @ org.osgi.util.tracker.servicetracker$tracked.servicechanged(servicetracker.java:894) @ org.apache.felix.framework.util.eventdispatcher.invokeservicelistenercallback(eventdispatcher.java:932) @ org.apache.felix.framework.util.eventdispatcher.fireeventimmediately(eventdispatcher.java:793) @ org.apache.felix.framework.util.eventdispatcher.fireserviceevent(eventdispatcher.java:543) @ org.apache.felix.framework.felix.fireserviceevent(felix.java:4419) @ org.apache.felix.framework.felix.registerservice(felix.java:3423) @ org.apache.felix.framework.bundlecontextimpl.registerservice(bundlecontextimpl.java:346) @ org.apache.felix.framework.bundlecontextimpl.registerservice(bundlecontextimpl.java:320) @ com.mypackage.person.bs.processor.processor.sendevent(processor.java:56) @ com.mypackage.jetmystream.event.support.abstracteventsource.firesendevent(abstracteventsource.java:97) @ com.mypackage.jetmystream.event.channel.messaging.inboundmessagingchannel.fireevent(inboundmessagingchannel.java:113) @ com.mypackage.jetmystream.event.channel.messaging.inboundmessagingchannel.onmessage(inboundmessagingchannel.java:204) @ com.mypackage.jetmystream.messaging.messageservice.dispatchmessageforcontext(messageservice.java:349) @ com.mypackage.jetmystream.messaging.messageservice.dispatch(messageservice.java:259) @ com.mypackage.jetmystream.messaging.messageservicerequest.execute(messageservicerequest.java:40) @ com.mypackage.jetmystream.util.requestthread.run(requestthread.java:69)

"requestthread" prio=10 tid=0x00000000425f8800 nid=0x1041 waiting monitor entry [0x00007fbdd3968000] java.lang.thread.state: blocked (on object monitor) @ org.apache.felix.framework.serviceregistry.registerservice(serviceregistry.java:109) - waiting lock <0x0000000700e2c590> (a org.apache.felix.framework.serviceregistry) @ org.apache.felix.framework.felix.registerservice(felix.java:3393) @ org.apache.felix.framework.bundlecontextimpl.registerservice(bundlecontextimpl.java:346) @ org.apache.felix.framework.bundlecontextimpl.registerservice(bundlecontextimpl.java:320) @ com.mypackage.person.bs.processor.processor.sendevent(bullseyemodelprocessor.java:56) @ com.mypackage.jetmystream.event.support.abstracteventsource.firesendevent(abstracteventsource.java:97) @ com.mypackage.jetmystream.event.channel.messaging.inboundmessagingchannel.fireevent(inboundmessagingchannel.java:113) @ com.mypackage.jetmystream.event.channel.messaging.inboundmessagingchannel.onmessage(inboundmessagingchannel.java:204) @ com.mypackage.jetmystream.messaging.messageservice.dispatchmessageforcontext(messageservice.java:349) @ com.mypackage.jetmystream.messaging.messageservice.dispatch(messageservice.java:259) @ com.mypackage.jetmystream.messaging.messageservicerequest.execute(messageservicerequest.java:40)

@ com.mypackage.jetmystream.util.requestthread.run(requestthread.java:69)

a couple of question on this:

  1. am doing wrong in sending map through registerservice. if alternatives?

  2. any ideas on how can work? have 26 nodes , need process 400 requests per second using mechanism

    anyone had similar issues? pointers highly appreciated

thanks masti

"am doing wrong in sending map through registerservice. if alternatives?"

yes! service registry not intended used way; not messaging bus.

as alternatives... why not use messaging bus? @ osgi event admin there many other implementations of idea.

"any ideas on how can work? have 26 nodes , need process 400 requests per second using mechanism"

you have bit more specific you're trying achieve. question abstract. please describe messages coming from, need delivered, processing (if any) need in middle, etc.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -