#3814: Fire exception in pipeline if async task in eventloop throws exception
This commit is contained in:
parent
f6151dce56
commit
1da3a8c240
@ -334,7 +334,7 @@ public final class UserConnection implements ProxiedPlayer
|
||||
{
|
||||
Preconditions.checkNotNull( request, "request" );
|
||||
|
||||
ch.getHandle().eventLoop().execute( () -> connect0( request ) );
|
||||
ch.scheduleIfNecessary( () -> connect0( request ) );
|
||||
}
|
||||
|
||||
private void connect0(final ServerConnectRequest request)
|
||||
|
@ -2,7 +2,6 @@ package net.md_5.bungee.connection;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.gson.Gson;
|
||||
import io.netty.channel.EventLoop;
|
||||
import java.math.BigInteger;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
@ -901,17 +900,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
||||
{
|
||||
return (result, error) ->
|
||||
{
|
||||
EventLoop eventLoop = ch.getHandle().eventLoop();
|
||||
if ( eventLoop.inEventLoop() )
|
||||
{
|
||||
if ( !ch.isClosing() )
|
||||
{
|
||||
callback.done( result, error );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
eventLoop.execute( () ->
|
||||
ch.scheduleIfNecessary( () ->
|
||||
{
|
||||
if ( !ch.isClosing() )
|
||||
{
|
||||
|
@ -238,6 +238,12 @@ public class ChannelWrapper
|
||||
return;
|
||||
}
|
||||
|
||||
ch.eventLoop().execute( task );
|
||||
ch.eventLoop().submit( task ).addListener( future ->
|
||||
{
|
||||
if ( !future.isSuccess() )
|
||||
{
|
||||
ch.pipeline().fireExceptionCaught( future.cause() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user