channel close..resulting in an i/o exception
432129
private boolean isClientChannelClosed(Throwable cause) {
        if (cause instanceof ClosedChannelException ||
                cause instanceof Errors.NativeIoException) {
            LOG.error("ZuulFilterChainHandler::isClientChannelClosed - IO Exception");
            return true;
        }
        return false;
    }
1293777
@Override
    public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
        endpoint.onDisconnected();
        super.channelClosed(ctx, e);
    }
179680
private void closeCurrent() throws IOException {
        virtualJarInputStream.closeEntry();
        currentEntry.crc = crc.getValue();
        crc.reset();
    }
1102580
private void potentiallyCloseLeakingChannel(final SocketChannel ch,
    final MemcachedNode node) {
    if (ch != null && !ch.isConnected() && !ch.isConnectionPending()) {
      try {
        ch.close();
      } catch (IOException e) {
        getLogger().error("Exception closing channel: %s", node, e);
      }
    }
  }
1281378
public void close()
        throws IOException
    {
        if (server != null) {
            OutputStream os = getOutputStream();
            this.os = null;

            MuxServer server = this.server;
            this.server = null;

            server.close(channel);
        }
    }
1333625
public void close() throws IOException {
    try {
      if (OGlobalConfiguration.FILE_LOCK.getValueAsBoolean())
        unlock();
      if (channel != null && channel.isOpen()) {
        channel.close();
        channel = null;
      }

      if (accessFile != null) {
        accessFile.close();
        accessFile = null;
      }

    } catch (Exception e) {
      OLogManager.instance().error(this, "Error on closing file " + osFile.getAbsolutePath(), e, OIOException.class);
    }
  }
1170822
public void close() throws IllegalStateException {
		if (this.open) {
			// Close channels
			this.rtpChannel.close();
			if (!this.rtcpMux) {
				this.rtcpChannel.close();
			}
			
			if(logger.isDebugEnabled()) {
				logger.debug(this.mediaType + " channel " + this.ssrc + " is closed");
			}

			// Reset state
			reset();
			this.open = false;
		} else {
			throw new IllegalStateException("Channel is already inactive");
		}
	}
1246621
public void handleError(SelectableChannel channel) {
    LOG.info("Handling Error. Cleaning states in HeronClient.");
    contextMap.clear();
    responseMessageMap.clear();
    messageMap.clear();
    socketChannelHelper.clear();
    nioLooper.removeAllInterest(channel);

    try {
      channel.close();
      LOG.info("Successfully closed the channel: " + channel);
    } catch (IOException e) {
      LOG.log(Level.SEVERE, "Failed to close connection in handleError", e);
    }

    // Since we closed the channel, we set isConnected false
    isConnected = false;
    onError();
  }
689412
public void close() throws IOException
  {
    unlock();

    _fileChannel = null;

    InputStream is = _is;
    _is = null;
    
    if (is != null)
      is.close();
  }
1143714
def channel_close(
            self,
            registry_address: PaymentNetworkID,
            token_address: TokenAddress,
            partner_address: Address,
            retry_timeout: NetworkTimeout = DEFAULT_RETRY_TIMEOUT,
    ):
        
        self.channel_batch_close(
            registry_address=registry_address,
            token_address=token_address,
            partner_addresses=[partner_address],
            retry_timeout=retry_timeout,
        )
877881
@Override
  public void close() throws IOException
  {
    SocketChannel s = _s;
    _s = null;
    
    if (s != null) {
      s.close();
    }

    /*
    OutputStream os = _os;
    _os = null;

    InputStream is = _is;
    _is = null;

    try {
      if (os != null)
        os.close();
      
      if (is != null)
        is.close();
    } finally {
      if (s != null)
        s.close();
    }
  */
  }
240889
@Override
    public void close(VirtualConnection inVC, Exception e) {

        // This H2InboundLink.close method should only get called from the H2HttpInboundLinkWrap.close method.
        // for this reason, if we sync this method, then if a stream changes state while we are looking at it, we should
        // be able to do the close when that stream closing causes this close method to be called.

        // the device link close should always use the initial VC that this object was created with, so inVC will be ignored.

        synchronized (linkStatusSync) {

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "close(vc,e): :linkstatus: is: " + linkStatus + " :close: H2InboundLink hc: " + this.hashCode());
            }

            if ((linkStatus == LINK_STATUS.CLOSING) || (linkStatus == LINK_STATUS.GOAWAY_SENDING)
                || (linkStatus == LINK_STATUS.WAIT_TO_SEND_GOAWAY)) {
                // another thread is in charge of closing, or another thread has already armed the future to close
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "close(vc,e): returning: close of muxLink is being done on a differnt thread" + " :close: H2InboundLink hc: " + this.hashCode());
                }
                return;
            }

            if (e == null) {
                // Attempt to close down cleanly if all streams are closed.

                //Determine if all streams are in half closed or closed state
                //If not, do nothing and return
                //If so, look to see if the GoAway frame has been sent
                //If not, trigger a timer and wait to send the GOAWAY frame
                //If so, call close on the TCP-Channel/Device-Channel below us

                H2StreamProcessor stream;
                for (Integer i : streamTable.keySet()) {
                    stream = streamTable.get(i);

                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "close(vc,e): looking at stream: " + stream.getId());
                    }

                    if (stream.getId() != 0 && !stream.isHalfClosed() && !stream.isStreamClosed() && highestLocalStreamId > -1) {
                        continue;
                    } else {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, "close(vc,e): stream not ready to close: " + stream.getId() + " :close: H2InboundLink hc: " + this.hashCode());
                        }
                        return;
                    }
                }
            }

            // All streams are either closed or in half closed, and a GOAWAY frame needs to be sent
            // Wait the timeout time and then send the GOAWAY frame with the last good stream

            linkStatus = LINK_STATUS.WAIT_TO_SEND_GOAWAY;
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "close(vc,e): loading up the wait to close timeout" + " :close: H2InboundLink hc: " + this.hashCode());
            }

            ScheduledExecutorService scheduler = CHFWBundle.getScheduledExecutorService();
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "close : scheduler : " + scheduler + " config : " + config);
            }
            connTimeout = new H2ConnectionTimeout(e);

            if (e == null) {
                // close cleanly if no other traffic has been received for this H2 connection within the timeout
                // Save the future so we can cancel it later on
                closeFuture = scheduler.schedule(connTimeout, config.getH2ConnCloseTimeout(), TimeUnit.SECONDS);
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "close(vc,e): close on link called with exception: " + e);
                }
                // do the close immediately on this thread
                connTimeout.run();
            }
        }
    }
12973
public void close() throws IOException {
        if(inp != null)
            inp.close();
        if(out != null)
            out.close();
    }
461306
public void close() throws IOException {
        for (;;) {
            int state = this.state;
            if (isClosed(state)) {
                return;
            }
            // Once a close operation happens, the channel is considered shutdown.
            if (casState(state, state | STATE_ALL_MASK)) {
                break;
            }
        }
        int res = close(fd);
        if (res < 0) {
            throw newIOException("close", res);
        }
    }
65405
public void close() throws IOException
	{
		if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
			logger.logp(Level.FINE, CLASS_NAME,"close", "close");
        }
		// Were we requested to close the underlying stream ?
		finish();
		try
		{
			out.close();
		}
		catch (Exception ex)
		{
		  com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.webcontainer.srt.BufferedServletOutputStream.close", "415", this);
		}
		//PK89810	Start	
		if (WCCustomProperties.FINISH_RESPONSE_ON_CLOSE){
			// If WCCustomProperties.FINISH_RESPONSE_ON_CLOSE is set and stream is already obtained and being closed. 
			// User will not be allowed to print more data ,outputstreamClosed will be set to true and default is false.			 
			outputstreamClosed = true;
			if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) 
				logger.logp(Level.FINE, CLASS_NAME,"close", "outputstreamClosed value --> " + outputstreamClosed);			
		}//PK89810 End
    }
238098
private void closeChannel() {
        if (this.channel != null) {
            if (this.channel.isConnected()) {
                try {
                    this.channel.disconnect();
                } catch (IOException e) {
                    logger.warn(e.getMessage(), e);
                }
            }

            if (this.channel.isOpen()) {
                try {
                    this.channel.close();
                } catch (IOException e) {
                    logger.warn(e.getMessage(), e);
                }
            }
        }
    }
757442
private static void waitForChannelClosure(Channel channel, long timoutInMs) {
        final long start = System.currentTimeMillis();
        final long until = start + timoutInMs;
        try {
            while (!channel.isClosed() && System.currentTimeMillis() < until) {
                Thread.sleep(CLOSURE_WAIT_INTERVAL);
            }
            logger.trace("Time waited for channel closure: " + (System.currentTimeMillis() - start));
        } catch (InterruptedException e) {
            logger.trace("Interrupted", e);
        }
        if (!channel.isClosed()) {
            logger.trace("Channel not closed in timely manner!");
        }
    }