Summary:
Both event_base_new and event_init return nullptr when out of file descriptors.
Using null event_base will result in segfault.
Test Plan: (ulimit -n 50000 && _build/opt/sigma/service/sigma_server --instance_name=si_sigma_push --min_scribe_log_level=0 --allow_status_port_fallback=true --minloglevel=1 --v=0 --feature_objects_limit=
1000000 --hbase_default_timeout_ms=250 --max_total_connections_per_region_server=10 --max_retained_connections_per_region_server=10 --tao_default_timeout_ms=5000 --enable_writes_scribe_si_floop=false --enable_writes_all=false --arena_size_limit=
268435456 --run_fxl=true)
Reviewed By: davejwatson@fb.com
FB internal diff:
D1311855
, startWork_(0)
, observer_(nullptr)
, observerSampleCount_(0) {
+ if (UNLIKELY(evb_ == nullptr)) {
+ LOG(ERROR) << "EventBase(): Failed to init event base.";
+ folly::throwSystemError("error in EventBase::EventBase()");
+ }
VLOG(5) << "EventBase(): Created.";
initNotificationQueue();
RequestContext::getStaticContext();
, startWork_(0)
, observer_(nullptr)
, observerSampleCount_(0) {
+ if (UNLIKELY(evb_ == nullptr)) {
+ LOG(ERROR) << "EventBase(): Pass nullptr as event base.";
+ throw std::invalid_argument("EventBase(): event base cannot be nullptr");
+ }
initNotificationQueue();
RequestContext::getStaticContext();
}