7 #include <boost/assign.hpp>
8 #include <sys/resource.h>
14 using process::ProcessState;
20 static bool policy_set;
29 TaskPolicy config_policy = boost::assign::list_of
55 TaskPolicy config_helper_policy = boost::assign::list_of
75 config_helper_policy);
78 TaskPolicy static_service_chain_policy = boost::assign::list_of
90 static_service_chain_policy);
92 static_service_chain_policy);
113 TaskPolicy peer_membership_policy = boost::assign::list_of
126 peer_membership_policy);
131 TaskPolicy send_update_policy = boost::assign::list_of
137 send_update_policy.push_back(
144 TaskPolicy send_ready_policy = boost::assign::list_of
154 TaskPolicy evpn_segment_policy = boost::assign::list_of
165 evpn_segment_policy);
168 TaskPolicy rtfilter_policy = boost::assign::list_of
178 TaskPolicy resolver_path_policy = boost::assign::list_of
189 resolver_path_policy);
192 TaskPolicy resolver_nexthop_policy = boost::assign::list_of
199 resolver_nexthop_policy);
202 TaskPolicy route_aggregation_policy = boost::assign::list_of
213 route_aggregation_policy);
216 TaskPolicy db_ifmap_policy = boost::assign::list_of
228 TaskPolicy walker_policy = boost::assign::list_of
247 rlimit new_core_limit;
248 new_core_limit.rlim_cur = 0;
249 new_core_limit.rlim_max = 0;
250 setrlimit(RLIMIT_CORE, &new_core_limit);
257 bool bgpIsAdminDown,
bool configEndOfRibComputed,
259 if (!configEndOfRibComputed) {
260 *state = ProcessState::NON_FUNCTIONAL;
261 (*message) += (message->empty() ?
"" :
", ") +
262 string(
"IFMap Server End-Of-RIB not computed");
265 if (!bgpHasSelfConfiguration) {
266 *state = ProcessState::NON_FUNCTIONAL;
267 (*message) += (message->empty() ?
"" :
", ") +
268 string(
"No BGP configuration for self");
271 if (bgpIsAdminDown) {
272 *state = ProcessState::NON_FUNCTIONAL;
273 (*message) += (message->empty() ?
"" :
", ") +
274 string(
"BGP is administratively down");
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
void SetPolicy(int task_id, TaskPolicy &policy)
Sets the task exclusion policy. Adds policy entries for the task Examples:
static void Exit(bool do_assert)
int GetTaskId(const std::string &name)
static TaskScheduler * GetInstance()
static std::string GetProcessState(bool bgpHasSelfConfiguration, bool bgpIsAdminDown, bool configEndOfRibComputed, process::ProcessState::type *state, std::string *message)
std::vector< TaskExclusion > TaskPolicy
static void SetDefaultSchedulingPolicy()
static int PartitionCount()
int HardwareThreadCount()