This commit is contained in:
allegroai 2022-01-15 23:03:20 +02:00
parent b3176a223b
commit 097bf23481
6 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,6 @@
import abc import abc
import jsonschema import jsonschema
import os
import six import six
from .apimodel import ApiModel from .apimodel import ApiModel
@ -14,6 +13,7 @@ if ENV_API_DEFAULT_REQ_METHOD.exists() and ENV_API_DEFAULT_REQ_METHOD.get().uppe
"CLEARML_API_DEFAULT_REQ_METHOD environment variable must be 'get' or 'post' (any case is allowed)." "CLEARML_API_DEFAULT_REQ_METHOD environment variable must be 'get' or 'post' (any case is allowed)."
) )
class Request(ApiModel): class Request(ApiModel):
_method = ENV_API_DEFAULT_REQ_METHOD.get(default="get") _method = ENV_API_DEFAULT_REQ_METHOD.get(default="get")

View File

@ -1,5 +1,4 @@
import json as json_lib import json as json_lib
import os
import sys import sys
import types import types
from socket import gethostname from socket import gethostname

View File

@ -1,6 +1,5 @@
import abc import abc
import hashlib import hashlib
import os
import time import time
from functools import reduce from functools import reduce
from logging import getLevelName from logging import getLevelName

View File

@ -82,7 +82,7 @@ class BackgroundLogService(BackgroundMonitor):
def add_to_queue(self, record): def add_to_queue(self, record):
# check that we did not loose the reporter sub-process # check that we did not loose the reporter sub-process
if self.is_subprocess_mode() and not self._fast_is_subprocess_alive() and not self.get_at_exit_state(): ##HANGS IF RACE HOLDS! if self.is_subprocess_mode() and not self._fast_is_subprocess_alive() and not self.get_at_exit_state(): # HANGS IF RACE HOLDS!
# we lost the reporting subprocess, let's switch to thread mode # we lost the reporting subprocess, let's switch to thread mode
# gel all data, work on local queue: # gel all data, work on local queue:
self.send_all_records() self.send_all_records()

View File

@ -692,8 +692,10 @@ class BackgroundMonitor(object):
if self.get_at_exit_state(): if self.get_at_exit_state():
return self.is_subprocess_alive() and self._thread return self.is_subprocess_alive() and self._thread
return self.is_subprocess_alive() and self._thread and \ return self.is_subprocess_alive() and \
self._start_ev.is_set() and not self._done_ev.is_set() self._thread and \
self._start_ev.is_set() and \
not self._done_ev.is_set()
@classmethod @classmethod
def _fast_is_subprocess_alive(cls): def _fast_is_subprocess_alive(cls):