-
Bug
-
Resolution: Done
-
Major
-
7.4.18.GA
The Remoting class IntIndexHashMap is used in RemoteConnectionChannel to store the outbound messages leaving the channel endpoint and the inbound messages arriving at the channel endpoint.
private final IntIndexMap<OutboundMessage> outboundMessages = new IntIndexHashMap<OutboundMessage>(OutboundMessage.INDEXER, Equaller.IDENTITY, 512, 0.5f); private final IntIndexMap<InboundMessage> inboundMessages = new IntIndexHashMap<InboundMessage>(InboundMessage.INDEXER, Equaller.IDENTITY, 512, 0.5f);
For example, when an EJBClientChannel instance wants to send an invocation to an EJBServerChannel instance, it will call RemoteConnectionChannel.writeMessage() to create an OutboundMessage instance and write that instance into the outboundMessages map:
public MessageOutputStream writeMessage() throws IOException { int tries = 50; IntIndexMap<OutboundMessage> outboundMessages = this.outboundMessages; openOutboundMessage(); boolean ok = false; try { final Random random = ThreadLocalRandom.current(); while (tries > 0) { final int id = random.nextInt() & 0xfffe; if (! outboundMessages.containsKey(id)) { OutboundMessage message = new OutboundMessage((short) id, this, outboundWindow, maxOutboundMessageSize, messageAckTimeout); OutboundMessage existing = outboundMessages.putIfAbsent(message); if (existing == null) { ok = true; return message; } } tries --; } throw log.channelBusy(); } finally { if (! ok) { closeOutboundMessage(); } } }
We are finding that, under certain circumstances, the limit of 50 on the attempts to write a OutboundMessage into the map are failing, resulting a ChannelBusyException, and so failed invocations of the EJB client.
So the question arises: when using an IntIndexHashMap, how can it be tuned to avoid such errors?
- clones
-
REM3-419 IntIndexHashMap tuning
- Resolved
- is incorporated by
-
JBEAP-27647 (7.4.z) Upgrade JBoss Remoting 5.0.29.Final-redhat-00001 to 5.0.30.Final-redhat-00001
- Closed
- relates to
-
JBEAP-28065 [GSS](8.0.z) REM3-419 - IntIndexHashMap tuning
- Verified