Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting a Siddhi app with an invalid URL in a websocket sink is not aborted, after upgrading to org.wso2.transport.http:org.wso2.transport.http.netty-6.3.24 #28

Open
senthuran16 opened this issue Mar 14, 2022 · 0 comments

Comments

@senthuran16
Copy link
Member

Description:
When there is a websocket sink having an invalid URL in a Siddhi app, it is expected that, the Siddhi app should not successfully start, with an exception. This is being asserted in the following test case:

public void testWebSocketSinkInvalidUri() throws InterruptedException {

When upgrading to org.wso2.transport.http:org.wso2.transport.http.netty-6.3.24 (from 6.0.272), even though a SiddhiAppRuntimeException is thrown, it's not propagated. Instead, it's being caught and logged by io.netty.util.concurrent.DefaultPromise as follows:

[nioEventLoopGroup-58-1] WARN io.netty.util.concurrent.DefaultPromise - An exception was thrown by org.wso2.transport.http.netty.contractimpl.sender.websocket.WebSocketClient$$Lambda$43/876915855.operationComplete()
io.siddhi.core.exception.SiddhiAppRuntimeException: Error while connecting with the websocket server defined in 'io.siddhi.extension.map.xml.sourcemapper.XmlSourceMapper@671f7188'.
        at io.siddhi.extension.io.websocket.source.WebSocketSourceHandshakeListener.onError(WebSocketSourceHandshakeListener.java:50)
        at org.wso2.transport.http.netty.contractimpl.websocket.DefaultClientHandshakeFuture.notifyError(DefaultClientHandshakeFuture.java:64)
        at org.wso2.transport.http.netty.contractimpl.sender.websocket.WebSocketClient.lambda$handshake$0(WebSocketClient.java:112)
        at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:577)
        at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:570)
        at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:549)
        at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:490)
        at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:615)
        at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:608)
        at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117)
        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:321)
        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:337)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:702)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:748)
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:6060
Caused by: java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
        at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:330)
        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:702)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:748)

It seems that, io.netty.util.concurrent.DefaultPromise is being engaged due to the addition of addListener, which was introduced in wso2/transport-http#364.

@senthuran16 senthuran16 changed the title Starting a Siddhi app with an invalid URL in a websocket sink is not aborted, after upgrading toorg.wso2.transport.http:org.wso2.transport.http.netty-6.3.24 Starting a Siddhi app with an invalid URL in a websocket sink is not aborted, after upgrading to org.wso2.transport.http:org.wso2.transport.http.netty-6.3.24 Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant