class_docstr: Class for managing threads which run concurrent Spark jobs.
  
  This maintains a primary dispatcher thread, plus 1 thread per Hyperopt trial.
  Each trial's thread runs 1 Spark job with 1 task.
code: def _write_cancellation_back(trial, e):
      trial["state"] = base.JOB_STATE_CANCEL
      trial["misc"]["error"] = (str(type(e)), str(e))
      trial["refresh_time"] = coarse_utcnow()
  
imports: import copy
  import os
  import threading
  import time
  import timeit
  import traceback
  from hyperopt import base, fmin, Trials
  from hyperopt.base import validate_timeout, validate_loss_threshold, STATUS_OK
  from hyperopt.utils import coarse_utcnow, _get_logger, _get_random_id
label_desc: Use image node_id 10 for calling the _SparkFMinState obj's underlying member method code with example usage: obj._write_cancellation_back(trial, e) without return types