[Design of Messaging on JBoss (Messaging/JBoss)] - Problem in shutdown of JBoss AS 'all' config
by bstansberry@jboss.com
There's a problem in the JBM shutdown in the AS 'all' config.
Basically, the shutdown calls *synchronized* MessagingPostOffice.stop(). That calls channel.close(), which results in a callback from a JGroups thread on the viewAccepted() callback. That tries to call into *synchronized* MessagingPostOffice.calculateFailoverMap().
This basically "deadlocks" until the shutdown thread times out waiting for the view dissemination process to complete:
2008-02-05 11:49:30,201 WARN [org.jgroups.mux.Multiplexer] failed to collect all service ACKs (1) for [dst: , src: 10.18.86.175:39649 (4 headers), size=0 bytes] after 2000ms, missing ACKs from [10.18.86.175:39649] (received=[]), local_addr=10.18.86.175:39649
At that point the shutdown thread is free to continue executing stop(), and ends up setting MessagingPostOffice.failoverMap to null. It then returns from stop(), freeing the JGroups thread to enter calculateFailoverMap(). NPE due to failoverMap being null:
2008-02-05 11:49:41,515 ERROR [org.jboss.messaging.core.impl.postoffice.GroupMember] Caught Exception in MembershipListener
java.lang.NullPointerException
at org.jboss.messaging.core.impl.postoffice.MessagingPostOffice.calculateFailoverMap(MessagingPostOffice.java:1939)
at org.jboss.messaging.core.impl.postoffice.MessagingPostOffice.nodesLeft(MessagingPostOffice.java:899)
at org.jboss.messaging.core.impl.postoffice.GroupMember$ControlMembershipListener.viewAccepted(GroupMember.java:498)
at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.handleUpEvent(MessageDispatcher.java:704)
at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:747)
at org.jgroups.JChannel.up(JChannel.java:1151)
at org.jgroups.mux.Multiplexer.passToMuxChannel(Multiplexer.java:990)
at org.jgroups.mux.Multiplexer.handleServiceDown(Multiplexer.java:783)
at org.jgroups.mux.Multiplexer.handleServiceMessage(Multiplexer.java:715)
at org.jgroups.mux.Multiplexer.up(Multiplexer.java:267)
at org.jgroups.JChannel.up(JChannel.java:1151)
Bela/Vladimir, I thought you'd fixed things so a MuxChannel user wouldn't get a viewAccepted() callback when closing its channel. You don't get one when closing a regular JChannel. Perhaps my memory is faulty.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4126874#4126874
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4126874
18 years, 2 months
[Design the new POJO MicroContainer] - Using a CompositeMetaType for a Map with String keys?
by scott.stark@jboss.org
Right now MetaTypeFactory.resolve(Map[String,?].class) returns a TableMetaType. It seems more natural for this to be a CompositeMetaType that does not restrict the item names when the Map has String keys, for example:
| MutableCompositeMetaType expected = new MutableCompositeMetaType(HashMap.class.getName(), "HashMap<String,String>");
| expected.addItem("key1", "key1", SimpleMetaType.STRING);
| expected.addItem("key2", "key2", SimpleMetaType.STRING);
| expected.addItem("key3", "key3", SimpleMetaType.STRING);
| expected.freeze();
|
| String[] itemNames = {"key1", "key2", "key3"};
| MetaValue[] itemValues = {SimpleValueSupport.wrap("value1"), SimpleValueSupport.wrap("value3"), SimpleValueSupport.wrap("value3")};
| CompositeValueSupport mapValue = new CompositeValueSupport(expected, itemNames, itemValues);
| MetaValue value1 = mapValue.get("key1");
|
A new MapValueSupport could implement this type of CompositeValue. The TableMetaType/TableValue seem very awkward for this type of map. Is there a reason not to support this and require all Maps to be TableMetaType/TableValue?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4126829#4126829
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4126829
18 years, 2 months