// L2272
/*
Aborts runing merges. Be careful when using this method: when you
abort a long-running merge, you lose a lot of work that must later be
redone.
*/
198634
func (mc *MergeControl) abortAllMerges() {
	mc.Lock() // synchronized
	defer mc.Unlock()

	mc.stopMerges = true

	// Abort all pending & running merges:
	for e := mc.pendingMerges.Front(); e != nil; e = e.Next() {
		merge := e.Value.(*OneMerge)
		if mc.infoStream.IsEnabled("IW") {
			mc.infoStream.Message("IW", "now abort pending merge %v",
				mc.readerPool.segmentsToString(merge.segments))
		}
		merge.abort()
		mc.mergeFinish(merge)
	}
	mc.pendingMerges.Init()

	for merge, _ := range mc.runningMerges {
		if mc.infoStream.IsEnabled("IW") {
			mc.infoStream.Message("IW", "now abort running merge %v",
				mc.readerPool.segmentsToString(merge.segments))
		}
		merge.abort()
	}

	// These merges periodically check whether they have
	// been aborted, and stop if so.  We wait here to make
	// sure they all stop.  It should not take very long
	// because the merge threads periodically check if
	// they are aborted.
	for len(mc.runningMerges) > 0 {
		if mc.infoStream.IsEnabled("IW") {
			mc.infoStream.Message("IW", "now wait for %v running merge(s) to abort",
				len(mc.runningMerges))
		}
		mc.mergeSignal.Wait()
	}

	mc.stopMerges = false

	assert(len(mc.mergingSegments) == 0)

	if mc.infoStream.IsEnabled("IW") {
		mc.infoStream.Message("IW", "all running merges have aborted")
	}
}
1206084
func (m TaskManager) AbortTask(c context.Context, ctl task.Controller) error {
	// This can happen if the invocation is aborted before it has even started.
	// We don't have buildbucket build ID yet to cancel.
	//
	// There's a high chance that LaunchTask is executing concurrently somewhere.
	// We let it finish peacefully, by not touching the invocation state at all
	// and failing with a transient error instead. This avoids a collision on
	// State modification. When such collision happens, results of LaunchTask
	// (including a fresh build ID) are discarded (as the engine is unable to
	// "merge" conflicting mutations from two different state transitions). This
	// is really bad, since this process produces orphaned Buildbucket builds.
	//
	// So we pick a lesser evil and make AbortTask fail transiently while
	// invocation is starting.
	if status := ctl.State().Status; status.Initial() {
		return errors.Reason("can't abort Buildbucket invocation in state %q", status).Tag(transient.Tag).Err()
	}

	// Grab build ID from the blob generated in LaunchTask.
	taskData, err := readTaskData(ctl)
	if err != nil {
		ctl.State().Status = task.StatusFailed
		return err
	}

	// Ask Buildbucket to kill this build.
	return utils.WrapAPIError(m.withBuildbucket(c, ctl, func(c context.Context, bb *bbv1.Service) error {
		_, err := bb.Cancel(taskData.BuildID, &bbv1.ApiCancelRequestBodyMessage{}).Context(c).Do()
		return err
	}))
}
74159
func (r *Response) Abort(status int, body string) {
	r.ResponseWriter.WriteHeader(status)
	r.WriteString(body)
}
135550
func MergeMultierrorWarnings(warnings ...error) string {
	var warningMsg multierror.Error
	for _, warn := range warnings {
		if warn != nil {
			multierror.Append(&warningMsg, warn)
		}
	}

	if len(warningMsg.Errors) == 0 {
		return ""
	}

	// Set the formatter
	warningMsg.ErrorFormat = warningsFormatter
	return warningMsg.Error()
}
886596
func (p *AuroraSchedulerManagerClient) AbortJobUpdate(ctx context.Context, key *JobUpdateKey, message string) (r *Response, err error) {
  var _args153 AuroraSchedulerManagerAbortJobUpdateArgs
  _args153.Key = key
  _args153.Message = message
  var _result154 AuroraSchedulerManagerAbortJobUpdateResult
  if err = p.Client_().Call(ctx, "abortJobUpdate", &_args153, &_result154); err != nil {
    return
  }
  return _result154.GetSuccess(), nil
}
788440
func (self *Boxfile) MergeProc(box Boxfile) {
  for key, val := range box.Parsed {
    self.Parsed[key] = map[string]interface{}{"exec": val}
  }
}
644310
func (txn *Txn) Abort() {
	// Noop for a read transaction
	if !txn.write {
		return
	}

	// Check if already aborted or committed
	if txn.rootTxn == nil {
		return
	}

	// Clear the txn
	txn.rootTxn = nil
	txn.modified = nil

	// Release the writer lock since this is invalid
	txn.db.writer.Unlock()
}
350033
func (c *Client) AbortCurrentUpgrade() error {
	if err := c.checkCanWrite(); err != nil {
		return err
	}

	if err := c.check.ChangeAllowed(); err != nil {
		return errors.Trace(err)
	}
	return c.api.stateAccessor.AbortCurrentUpgrade()
}
351139
func (ns *Namespace) Merge(p2, p1 interface{}) (interface{}, error) {
	merger, ok := p1.(pagesLanguageMerger)
	if !ok {
		return nil, fmt.Errorf("language merge not supported for %T", p1)
	}
	return merger.MergeByLanguageInterface(p2)
}
1033546
func (s *Storage) MergeHelper(ctx context.Context,
	convID chat1.ConversationID, uid gregor1.UID, msgs []chat1.MessageUnboxed, expunge *chat1.Expunge) (res MergeResult, err Error) {
	defer s.Trace(ctx, func() error { return err }, "MergeHelper")()
	lock := locks.StorageLockTab.AcquireOnName(ctx, s.G(), convID.String())
	defer lock.Release(ctx)

	s.Debug(ctx, "MergeHelper: convID: %s uid: %s num msgs: %d", convID, uid, len(msgs))

	// Fetch secret key
	key, ierr := GetSecretBoxKey(ctx, s.G().ExternalG(), DefaultSecretUI)
	if ierr != nil {
		return res, MiscError{Msg: "unable to get secret key: " + ierr.Error()}
	}

	ctx, err = s.engine.Init(ctx, key, convID, uid)
	if err != nil {
		return res, err
	}

	// Write out new data into blocks
	if err = s.engine.WriteMessages(ctx, convID, uid, msgs); err != nil {
		return res, s.maybeNukeLocked(ctx, false, err, convID, uid)
	}

	// Update supersededBy pointers
	updateRes, err := s.updateAllSupersededBy(ctx, convID, uid, msgs)
	if err != nil {
		return res, s.maybeNukeLocked(ctx, false, err, convID, uid)
	}
	res.ReactionTargets = updateRes.reactionTargets
	res.UnfurlTargets = updateRes.unfurlTargets
	res.RepliesAffected = updateRes.repliesAffected

	if err = s.updateMinDeletableMessage(ctx, convID, uid, msgs); err != nil {
		return res, s.maybeNukeLocked(ctx, false, err, convID, uid)
	}

	// Process any DeleteHistory messages
	expunged, err := s.handleDeleteHistory(ctx, convID, uid, msgs, expunge)
	if err != nil {
		return res, s.maybeNukeLocked(ctx, false, err, convID, uid)
	}
	res.Expunged = expunged

	exploded, err := s.explodeExpiredMessages(ctx, convID, uid, msgs)
	if err != nil {
		return res, s.maybeNukeLocked(ctx, false, err, convID, uid)
	}
	res.Exploded = exploded

	// Update max msg ID if needed
	if len(msgs) > 0 {
		if err := s.idtracker.bumpMaxMessageID(ctx, convID, uid, msgs[0].GetMessageID()); err != nil {
			return res, s.maybeNukeLocked(ctx, false, err, convID, uid)
		}
	}

	// queue search index update in the background
	go s.G().Indexer.Add(ctx, convID, uid, msgs)

	return res, nil
}
1117653
func (d *Domain) AbortJob() error {
	var err C.virError
	result := C.virDomainAbortJobWrapper(d.ptr, &err)
	if result == -1 {
		return makeError(&err)
	}
	return nil
}
64877
func (behavior *Behavior) MergeOptions(newOptions OptionValue) {
	options := make(map[string]interface{})
	for k, v := range behavior.Options {
		options[k] = v
	}

	for k, v := range newOptions {
		options[k] = v
	}

	behavior.Options = OptionValue(options)
}
285268
func (merger *MatchMerger) merge(block1, block2 *BlockSpan, blockSize int64) {
	var a, b *BlockSpan = block1, block2

	if block1.StartBlock > block2.StartBlock {
		a, b = block2, block1
	}

	if isBordering(a, b, blockSize) {
		// bordering, merge
		// A ------ A B ------ B > A ---------------- A
		merger.startEndBlockMap.Delete(BlockSpanKey(a.EndBlock))
		merger.startEndBlockMap.Delete(BlockSpanKey(b.StartBlock))
		a.EndBlock = b.EndBlock

		merger.startEndBlockMap.ReplaceOrInsert(BlockSpanStart(*a))
		merger.startEndBlockMap.ReplaceOrInsert(BlockSpanEnd(*a))
	}
}
1223771
func (ctx *Context) Abort(status int, body ...string) {
	ctx.Result = Abort(status, body...)
	ctx.HandleError()
}
1070903
func (repo *Repository) GetMergeBase(base, head string) (string, error) {
	stdout, err := NewCommand("merge-base", base, head).RunInDir(repo.Path)
	if err != nil {
		if strings.Contains(err.Error(), "exit status 1") {
			return "", ErrNoMergeBase{}
		}
		return "", err
	}
	return strings.TrimSpace(stdout), nil
}
89794
func (a *customAdapter) abortWorkerProcess(ctx *customAdapterWorkerContext) {
	a.Trace("xfer: Aborting worker process: %d", ctx.workerNum)
	ctx.stdin.Close()
	ctx.stdout.Close()
	ctx.cmd.Process.Kill()
}
445431
func (cwg *ControlWaitGroup) Abort() {
	cwg.mu.Lock()
	cwg.abort = true
	cwg.mu.Unlock()
}