Handle event_base_new failure when out of file descriptors.
authorZejun Wu <watashi@fb.com>
Tue, 6 May 2014 00:08:36 +0000 (17:08 -0700)
committerDave Watson <davejwatson@fb.com>
Tue, 20 May 2014 19:53:57 +0000 (12:53 -0700)
commitfc2b0aa26a044486972ca8f2d526416a01b671d4
treea0124718ec0ccc9fe3b7b0001c1370b0c1403791
parent99b82090d699367c74ecc9d4c6e6acb9d0b276da
Handle event_base_new failure when out of file descriptors.

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
folly/io/async/EventBase.cpp