Changes
Started by upstream project gerrit-osmo-s1gw #712
Started 55 min ago
Queued 6.1 sec
Took 6 min 17 sec
on built-in
rest_server: fix TOC/TOU race when listing/fetching E-RABs
The list of E-RAB FSM pids is a snapshot taken at one point in time.
By the time we interrogate each erab_fsm process individually, any of
them may have already terminated (e.g. bearer released mid-request).
The current code fails to generate a response if this happens.
* fetch_erab_info/1: add a pid() clause that wraps erab_list_item/1
in a try/catch, returning 'error' if the process is gone.
* fetch_erab_info/1: catch both exit forms
** `{noproc, _}` raised by gen_statem:call/2 on a monitored pid, and
** the bare noproc atom for other code paths.
* fetch_erab_list/1: switch from lists:map to lists:filtermap and
call fetch_erab_info/1 per E-RAB, silently dropping any that died
between the snapshot and the per-process interrogation.
Change-Id: I160b413aa535f2379ad4e40a3ae8f37c5bce2067
Related: SYS#7066
The list of E-RAB FSM pids is a snapshot taken at one point in time.
By the time we interrogate each erab_fsm process individually, any of
them may have already terminated (e.g. bearer released mid-request).
The current code fails to generate a response if this happens.
* fetch_erab_info/1: add a pid() clause that wraps erab_list_item/1
in a try/catch, returning 'error' if the process is gone.
* fetch_erab_info/1: catch both exit forms
** `{noproc, _}` raised by gen_statem:call/2 on a monitored pid, and
** the bare noproc atom for other code paths.
* fetch_erab_list/1: switch from lists:map to lists:filtermap and
call fetch_erab_info/1 per E-RAB, silently dropping any that died
between the snapshot and the per-process interrogation.
Change-Id: I160b413aa535f2379ad4e40a3ae8f37c5bce2067
Related: SYS#7066