Skip to content

Commit

Permalink
squash. THOUGHTS ON HOW TO DISABLE AUTO-LOADING OF CORE.RE BY NREP.
Browse files Browse the repository at this point in the history
  • Loading branch information
korydraughn committed Oct 14, 2024
1 parent e801376 commit dcb0b44
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions server/main_server/src/agent_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ int main(int _argc, char* _argv[])
fd_set sockMask;
FD_ZERO(&sockMask); // NOLINT(readability-isolate-declaration)

log_af::info("{}: Waiting for client request.", __func__);
while (true) {
if (g_terminate) {
log_af::info("{}: Received shutdown instruction. Exiting agent factory main loop.", __func__);
Expand All @@ -361,7 +360,7 @@ int main(int _argc, char* _argv[])
time_out.tv_sec = 0;
time_out.tv_usec = 500 * 1000;

// FIXME Replace use of select() with epoll() or Boost.Asio.
// FIXME Replace use of select() with pselect() or epoll().
while ((numSock = select(svrComm.sock + 1, &sockMask, nullptr, nullptr, &time_out)) == -1) {
if (g_terminate) {
log_af::info("{}: Received shutdown instruction. Exiting agent factory select() loop.", __func__);
Expand Down Expand Up @@ -914,7 +913,17 @@ namespace
cleanupAndExit(status);
}

irods::re_plugin_globals.reset(new irods::global_re_plugin_mgr);
// TODO This is initialized during agent factory startup. Why do we create a new one after forking the agent?
//irods::re_plugin_globals.reset(new irods::global_re_plugin_mgr);
// TODO This line invokes the start operation of all rule engine plugins. If a plugin opens a resource
// that cannot be shared (e.g. a database connection), then we have to come up with another way of
// achieving our goal of no config changes taking effect until a config reload/restart.
//
// All we want to do is make it so that configuration is static on server startup. Can a pre-startup
// entry point help with that? It would be run by the agent factory and only setup state for later use.
// Things that are considered a limited resource would NOT be handled here. This would make reloading of
// plugin configuration easier because the pre-startup logic is independent and well-defined. However, that's
// not something we need to worry about since the reload logic for the server simply forks new processes.
irods::re_plugin_globals->global_re_mgr.call_start_operations();

// TODO Cannot assume /var/lib/irods.
Expand Down

0 comments on commit dcb0b44

Please sign in to comment.