Skip to content

Commit 2789d60

Browse files
authored
nsfs | wait for endpoint startup before namespace monitor registration (#8474)
Signed-off-by: Amit Prinz Setter <alphaprinz@gmail.com>
1 parent bfaa477 commit 2789d60

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/endpoint/endpoint.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,15 @@ async function main(options = {}) {
231231
if (internal_rpc_client && config.NAMESPACE_MONITOR_ENABLED) {
232232
endpoint_stats_collector.instance().set_rpc_client(internal_rpc_client);
233233

234-
// Register a bg monitor on the endpoint
235-
background_scheduler.register_bg_worker(new NamespaceMonitor({
236-
name: 'namespace_fs_monitor',
237-
client: internal_rpc_client,
238-
should_monitor: nsr => Boolean(nsr.nsfs_config),
239-
}));
234+
//wait with monitoring until pod has started
235+
setTimeout(() => {
236+
// Register a bg monitor on the endpoint
237+
background_scheduler.register_bg_worker(new NamespaceMonitor({
238+
name: 'namespace_fs_monitor',
239+
client: internal_rpc_client,
240+
should_monitor: nsr => Boolean(nsr.nsfs_config),
241+
}));
242+
}, 1000 * 60);
240243
}
241244

242245
if (config.ENABLE_SEMAPHORE_MONITOR) {

0 commit comments

Comments
 (0)