If this channel becomes inactive, then notify all buffered writes that we failed.
186947
@Override
  public void channelInactive(ChannelHandlerContext ctx) {
    Status status = Status.UNAVAILABLE.withDescription(
        "Connection closed while performing protocol negotiation for " + ctx.pipeline().names());
    failWrites(status.asRuntimeException());
  }
131383
private synchronized void notifyWriters() throws IOException {
    LOG.debug("Notifying writers after " + rowsAddedSinceCheck);
    for(WriterInfo writer: writerList.values()) {
      if (lowMemoryMode) {
        // If we're in low memory mode and a writer
        // 1) flushes twice in a row, mark it as needy
        // 2) doesn't flush twice in a row, mark it for a decreased allocation
        if (writer.flushedCount == 0) {
          writersForDeallocation.add(writer);
        } else if (writer.flushedCount >= 2){
          writersForAllocation.add(writer);
        }
        writer.resetFlushedCount();
      }
    }

    if (lowMemoryMode) {
      reallocateMemory(writersForAllocation, writersForDeallocation);
      writersForDeallocation.clear();
      writersForAllocation.clear();
    }

    rowsAddedSinceCheck = 0;
  }
1062673
private void closeChannelWithLoginFailure(Channel channel)
	{
		ChannelFuture future = channel.write(NettyUtils
				.createBufferForOpcode(Events.LOG_IN_FAILURE));
		future.addListener(ChannelFutureListener.CLOSE);
	}
1235221
def ignore_failed_logs_action(self, request, queryset):
        """"""
        count = _ignore_failed_logs(queryset)
        self.message_user(
            request,
            _('{count} failed trigger logs marked as ignored.').format(count=count),
        )
329781
@Override
  public void fail(Throwable exn)
  {
    log.log(Level.WARNING, exn.toString(), exn);
  }
360159
def _fail(self, event, message='Invalid credentials'):
        """"""

        notification = {
            'component': 'auth',
            'action': 'fail',
            'data': message
        }

        ip = event.sock.getpeername()[0]

        self.failing_clients[ip] = event
        Timer(3, Event.create('notify_fail', event.clientuuid, notification, ip)).register(self)
1165155
def write_eof(self):
        """"""
        self._check_status()
        if not self._writable:
            raise TransportError('transport is not writable')
        if self._closing:
            raise TransportError('transport is closing')
        try:
            self._handle.shutdown(self._on_write_complete)
        except pyuv.error.UVError as e:
            self._error = TransportError.from_errno(e.args[0])
            self.abort()
            raise compat.saved_exc(self._error)
        self._write_buffer_size += 1
1018342
public void failed(Throwable failureCause) {
    Map<ClientTransport.PingCallback, Executor> callbacks;
    synchronized (this) {
      if (completed) {
        return;
      }
      completed = true;
      this.failureCause = failureCause;
      callbacks = this.callbacks;
      this.callbacks = null;
    }
    for (Map.Entry<ClientTransport.PingCallback, Executor> entry : callbacks.entrySet()) {
      notifyFailed(entry.getKey(), entry.getValue(), failureCause);
    }
  }
24187
public static void notifyFailed(PingCallback callback, Executor executor, Throwable cause) {
    doExecute(executor, asRunnable(callback, cause));
  }
635607
private void writeAndFlushNextMessageIfPossible(Channel channel) {
		if (channelError.get() != null || !channel.isWritable()) {
			return;
		}

		while (true) {
			RemoteInputChannel inputChannel = inputChannelsWithCredit.poll();

			// The input channel may be null because of the write callbacks
			// that are executed after each write.
			if (inputChannel == null) {
				return;
			}

			//It is no need to notify credit for the released channel.
			if (!inputChannel.isReleased()) {
				AddCredit msg = new AddCredit(
					inputChannel.getPartitionId(),
					inputChannel.getAndResetUnannouncedCredit(),
					inputChannel.getInputChannelId());

				// Write and flush and wait until this is done before
				// trying to continue with the next input channel.
				channel.writeAndFlush(msg).addListener(writeListener);

				return;
			}
		}
	}
495317
@Subscribe
  public void onFailure(Throwable t) {
    Toast.makeText(this, t.getMessage(), LENGTH_LONG).show();
  }
1066782
private void signalNotEmpty() {
        final ReentrantLock takeLock = this.takeLock;
        takeLock.lock();
        try {
            notEmpty.signal();
        } finally {
            takeLock.unlock();
        }
    }
1052403
public function markFailed($notify = true) {
		$this->Status = 'Failed';
		$this->log('Marking pipeline step as failed. See earlier log messages to determine cause.');
		$this->write();
		$this->Pipeline()->markFailed($notify);
	}
790314
function write (buffer, cb) {
		if (isStopped) return;

		if (buffer == null) {
			return write.end()
		}
		else {
			push(buffer)
		}
		release = cb;
	}
950196
public void notifyShutdown() {
		// System.out.println(" AtomCache got notify shutdown..");
		if (pdpprovider != null) {
			if (pdpprovider instanceof RemotePDPProvider) {
				RemotePDPProvider remotePDP = (RemotePDPProvider) pdpprovider;
				remotePDP.flushCache();
			}
		}

		// todo: use a SCOP implementation that is backed by SerializableCache
		ScopDatabase scopInstallation = ScopFactory.getSCOP();
		if (scopInstallation != null) {
			if (scopInstallation instanceof CachedRemoteScopInstallation) {
				CachedRemoteScopInstallation cacheScop = (CachedRemoteScopInstallation) scopInstallation;
				cacheScop.flushCache();
			}
		}

	}
502548
private void sendNSFailed(IConnection conn, String errorCode, String description, String name, Number streamId) {
        StreamService.sendNetStreamStatus(conn, errorCode, description, name, Status.ERROR, streamId);
    }
226642
protected final void notifyFailed(Throwable cause) {
    checkNotNull(cause);

    monitor.enter();
    try {
      State previous = state();
      switch (previous) {
        case NEW:
        case TERMINATED:
          throw new IllegalStateException("Failed while in state:" + previous, cause);
        case RUNNING:
        case STARTING:
        case STOPPING:
          snapshot = new StateSnapshot(FAILED, false, cause);
          failed(previous, cause);
          break;
        case FAILED:
          // Do nothing
          break;
        default:
          throw new AssertionError("Unexpected state: " + previous);
      }
    } finally {
      monitor.leave();
      executeListeners();
    }
  }