| 459 | params = self._get_spec_from_trial(trial) |
| 460 | |
| 461 | def run_task_on_executor(_): |
| 462 | domain = base.Domain( |
| 463 | local_eval_function, local_space, pass_expr_memo_ctrl=None |
| 464 | ) |
| 465 | |
| 466 | try: |
| 467 | result = domain.evaluate( |
| 468 | params, ctrl=None, attach_attachments=False |
| 469 | ) |
| 470 | yield result |
| 471 | except BaseException as e: |
| 472 | # Because the traceback is not pickable, we need format it and pass it back |
| 473 | # to driver |
| 474 | _traceback_string = traceback.format_exc() |
| 475 | logger.error(_traceback_string) |
| 476 | e._tb_str = _traceback_string |
| 477 | yield e |
| 478 | |
| 479 | try: |
| 480 | worker_rdd = self.spark.sparkContext.parallelize([0], 1) |