History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: BLZ-245
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Assignee: aglosban
Reporter: aglosban
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
BlazeDS

Channel failover not working correctly on blazeds/trunk.

Created: 09/25/08 01:45 PM   Updated: 01/20/09 01:29 PM
Component/s: Messaging
Security Level: Public (All JIRA Users )

Severity: Incorrectly Functioning
Reproducibility: Every Time
Discoverability: High
Found in Version: BlazeDS 4
Milestone: BlazeDS 4 Alpha 1
Affected OS(s): All OS Platforms - All
Steps to Reproduce:
Steps to reproduce:
1. Start up a reverse proxy server listening on a known port, for example 9999. I used Charles for this. Can start Charles, select Charles -> Preferences -> Reverse Proxies and enter "9999,localhost:8400" in the Proxy Mappings.
2. Edit the services-config.xml file for the qa-manual webapp and set the port for the data-polling-amf channel to 9999.

<channel-definition class="mx.messaging.channels.AMFChannel" id="data-polling-amf">
        <endpoint class="flex.messaging.endpoints.AMFEndpoint" url="http://{server.name}:9999/{context.root}/messagebroker/amfpolling"></endpoint>
        <properties>
            <polling-enabled>true</polling-enabled>
            <polling-interval-millis>5000</polling-interval-millis>
        </properties>
    </channel-definition>
3. Start tomcat on blazeds/trunk.
4. Run the MessagingApp in the qa-manual webapp: http://localhost:8400/qa-manual/messaging/MessagingApp.mxml.
5. In the consumer section of the app select data-polling-amf for the channel and click the "Add Channel" button. Repeat this process for a different channel so that there are two channels in the channel set.
6. Click the subscribe button and verify that the consumer is subscribed and connected through the reverse proxy on port 9999.
7. Kill the reverse proxy (Charles).
 
 Actual Results: The consumer keeps trying to resubscribe over the data-polling-amf channel until the resubscribe attempts limit is reached at which point it gives up.
 
 
 Expected Results: Would expect the consumer to try to reconnect over the data-polling-amf channel once and then failover to the next available channel in the channel set.
 
 
 Workaround (if any):
 
 
 
Language Found: English
Bugbase Id: none
Triaged: Yes
Regression: Yes
QA Owner: aglosban
Resolved by: Seth Hodgson
Participants: aglosban and Seth Hodgson
Browser: Internet Explorer 6.x
JDK: Sun JDK 5
Application Server: Apache Tomcat 6.x


 All   Comments      Sort Order:
Seth Hodgson - [09/29/08 03:44 PM ]
Not a bug - although you may need to run in a debugger to observe the behavior.

1. Client connects
2. Connection fails and client notices, dispatching a ChannelFaultEvent or ChannelEvent.DISCONNECT
* breakpoint client
3. Restore connection (by say, restarting the proxy)
* run client from breakpoint
4. Immediately following the fault or disconnect event, the Channel will reconnect to the same current URL, which will succeed resulting in the dispatch a connect event.

The scenario here is to survive a _very_ transient disconnect due to a proxy or firewall closing an idle connection. But the proxy or firewall is still running and will accept the nearly immediate reconnect attempt from the client. If the proxy, firewall or server is killed this immediate reconnect attempt fails and is followed by our regular channel failover and channelset hunting logic.

aglosban - [09/29/08 05:50 PM ]
>>If the proxy, firewall or server is killed this immediate reconnect attempt fails and is followed by our regular
>>channel failover and channelset hunting logic.

This is what's broken. I tested the same scenario on BlazeDS/3.0.x and on BlazeDS/trunk and channel failover is working correctly on 3.0.x but appears to be broken in trunk.

First I create a channel set with two channels. The first channel is a polling amf channel that goes through a proxy. The second channel is a streaming amf channel. I subscribe to a destination over the first channel and then kill the proxy.

On 3.0.x, when I kill the proxy I failover to the streaming amf channel. On trunk, when I kill the proxy, I'm not failing over to the streaming amf channel.

On both 3.0.x and trunk if I never start the proxy and try to subscribe to the destination with the same channels in the channel set, subscribing over the polling amf channel fails and then I failover to the streaming amf channel as I would expect.

Seth Hodgson - [10/09/08 01:33 PM ]
Thanks for clearing that up Alex!

BlazeDS revision 3542 contains an updated rpc.swc in local-swcs that fixes the issue.

aglosban - [01/20/09 01:29 PM ]
Verified. I added tests to the func test framework in LCDS that cover channel failover for most channel types in both BlazeDS and LCDS.