Skip to content

Commit

Permalink
nsfs | wait for endpoint startup before namespace monitor registration (
Browse files Browse the repository at this point in the history
#8474)

Signed-off-by: Amit Prinz Setter <[email protected]>
  • Loading branch information
alphaprinz authored Oct 28, 2024
1 parent bfaa477 commit 2789d60
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/endpoint/endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,15 @@ async function main(options = {}) {
if (internal_rpc_client && config.NAMESPACE_MONITOR_ENABLED) {
endpoint_stats_collector.instance().set_rpc_client(internal_rpc_client);

// Register a bg monitor on the endpoint
background_scheduler.register_bg_worker(new NamespaceMonitor({
name: 'namespace_fs_monitor',
client: internal_rpc_client,
should_monitor: nsr => Boolean(nsr.nsfs_config),
}));
//wait with monitoring until pod has started
setTimeout(() => {
// Register a bg monitor on the endpoint
background_scheduler.register_bg_worker(new NamespaceMonitor({
name: 'namespace_fs_monitor',
client: internal_rpc_client,
should_monitor: nsr => Boolean(nsr.nsfs_config),
}));
}, 1000 * 60);
}

if (config.ENABLE_SEMAPHORE_MONITOR) {
Expand Down

0 comments on commit 2789d60

Please sign in to comment.