Skip to content

Commit

Permalink
Merge branch 'release/3.19.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
alberttorosyan committed Apr 17, 2024
2 parents 94646d2 + 17cdf0b commit 2e7b8af
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.19.3 Apr 17, 2024
- Resolve issue with new runs after tracking queue shutdown (mihran113)
- Reset base path when opening new tabs (mihran113)

## 3.19.2 Mar 22, 2024
- Resolve live update failing issue (mihran113)
- Resolve issue with remote tracking protocol probe fail (mihran113)
Expand Down
2 changes: 1 addition & 1 deletion aim/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.19.2
3.19.3
15 changes: 6 additions & 9 deletions aim/ext/transport/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,7 @@
class Client:
_thread_local = threading.local()

_queue = RequestQueue(
'remote_tracker',
max_queue_memory=os.getenv(AIM_CLIENT_QUEUE_MAX_MEMORY, 1024 * 1024 * 1024),
retry_count=DEFAULT_RETRY_COUNT,
retry_interval=DEFAULT_RETRY_INTERVAL
)

def __init__(self, remote_path: str):
# temporary workaround for M1 build

self._id = str(uuid.uuid4())
if remote_path.endswith('/'):
remote_path = remote_path[:-1]
Expand All @@ -58,6 +49,12 @@ def __init__(self, remote_path: str):
self._tracking_endpoint = f'{self.remote_path}/tracking'
self.connect()

self._queue = RequestQueue(
f'remote_tracker_{self._id}',
max_queue_memory=os.getenv(AIM_CLIENT_QUEUE_MAX_MEMORY, 1024 * 1024 * 1024),
retry_count=DEFAULT_RETRY_COUNT,
retry_interval=DEFAULT_RETRY_INTERVAL
)
self._heartbeat_sender = HeartbeatSender(self)
self._heartbeat_sender.start()
self._thread_local.atomic_instructions = {}
Expand Down
4 changes: 2 additions & 2 deletions aim/ext/transport/request_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def register_task(self, client, task_f, *args):
self._client = weakref.ref(client)

if self._shutdown:
logger.debug('Cannot register task: rpc task queue is stopped.')
logger.debug('Cannot register task: task queue is stopped.')
return

arg_size = self._calculate_size(args)
Expand Down Expand Up @@ -100,7 +100,7 @@ def wait_for_finish(self):
def stop(self):
pending_task_count = self._queue.qsize()
if pending_task_count:
logger.warning(f'Processing {pending_task_count} pending tasks in the rpc queue \'{self._name}\'... '
logger.warning(f'Processing {pending_task_count} pending tasks in the task queue \'{self._name}\'... '
f'Please do not kill the process.')
self._queue.join()
logger.debug('No pending tasks left.')
Expand Down
2 changes: 1 addition & 1 deletion aim/web/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ui_v2",
"version": "3.19.2",
"version": "3.19.3",
"private": true,
"dependencies": {
"@aksel/structjs": "^1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ControlPopover from 'components/ControlPopover/ControlPopover';
import { Button, Icon, Text } from 'components/kit';
import { IconName } from 'components/kit/Icon';

import { getBasePath } from 'config/config';
import { EXPLORE_SELECTED_RUNS_CONFIG } from 'config/table/tableConfigs';
import { ANALYTICS_EVENT_KEYS } from 'config/analytics/analyticsKeysMap';

Expand Down Expand Up @@ -75,6 +76,7 @@ function CompareSelectedRunsPopover({
ANALYTICS_EVENT_KEYS[appName]?.table?.compareSelectedRuns,
);
if (newTab) {
url = `${getBasePath()}${url}`;
window.open(url, '_blank');
window.focus();
return;
Expand Down
19 changes: 14 additions & 5 deletions aim/web/ui/src/services/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface AuthToken {

const AUTH_TOKEN_KEY = 'Auth';
const AUTH_REFRESH_TOKEN_KEY = 'token';
const AUTH_USER_KEY = 'user';

export const CONTENT_TYPE = {
JSON: 'application/json',
Expand Down Expand Up @@ -265,6 +266,7 @@ function getAuthToken(): string {
*/
function removeAuthToken(): void {
localStorage.removeItem(AUTH_TOKEN_KEY);
localStorage.removeItem(AUTH_USER_KEY);
removeRefreshToken();
}

Expand Down Expand Up @@ -346,13 +348,20 @@ async function checkCredentials<T>(
if (response.status === 401) {
if (endpoint === `${ENDPOINTS.AUTH.BASE}/${ENDPOINTS.AUTH.REFRESH}`) {
removeAuthToken();
window.location.assign(`${window.location.origin}/sign-in`);
return parseResponse<T>(response);
}
// Refresh token
const token = await refreshToken().call();
if (token) {
setAuthToken(token);
return refetch();
if (localStorage.getItem('refreshing') !== 'true') {
localStorage.setItem('refreshing', 'true');
// Refresh token
const token = await refreshToken().call();
if (token) {
setAuthToken(token);
localStorage.setItem('refreshing', 'false');
window.location.reload();
return refetch();
}
localStorage.setItem('refreshing', 'false');
}
}
return parseResponse<T>(response);
Expand Down

0 comments on commit 2e7b8af

Please sign in to comment.