Looking how Emergency() vs ink_emergency() works.  The only difference is 
Emergency() calls Diags::cleanup_func() with is only defined in traffic_manager.

Here is the call stack for Emergency():
Emergency > DiagsError > diags->error > error_va > ink_emergency_va > 
::exit(UNRECOVERABLE_EXIT)

Vs
ink_emergency > ink_emergency_va > ::exit(UNRECOVERABLE_EXIT)

-Bryan


> On Jun 17, 2019, at 3:27 PM, Bryan Call <bc...@apache.org> wrote:
> 
> I would assume he is going to be calling ink_emergency(), so it wouldn’t be a 
> management API.
> 
> Fei, can you add more details about what "This API is a wrapper for the 
> "Emergency” call” is really going to do?
> 
> -Bryan
> 
> 
>> On Jun 17, 2019, at 3:22 PM, Leif Hedstrom <zw...@apache.org> wrote:
>> 
>> 
>> 
>>> On Jun 17, 2019, at 4:16 PM, Bryan Call <bc...@apache.org> wrote:
>>> 
>>> I would recommend having it like TSDebug and TSError.
>>> 
>>> tsapi void TSEmergency(const char *fmt, ...) TS_PRINTFLIKE(1, 2);
>>> 
>>> TSDebug and TSError:
>>> tsapi void TSDebug(const char *tag, const char *format_str, ...) 
>>> TS_PRINTFLIKE(2, 3);
>>> tsapi void TSError(const char *fmt, ...) TS_PRINTFLIKE(1, 2);
>>> 
>> 
>> 
>> What I don’t like with the original idea is that we’re putting management 
>> APIs (which we have ts/mgmt.h for) into the plugin APIs. There should be 
>> nothing stopping a plugin from using the management APIs I don’t think? If 
>> there is, that’s yet another issue. 
>> 
>> I feel reasonably strongly about not merging ts/hmgmt.h functionality into 
>> ts/ts.h.
>> 
>> — Leif
>> 
>>> 
>>> -Bryan
>>> 
>>> 
>>>> On Jun 17, 2019, at 2:13 PM, Fei Deng <duke8...@apache.org> wrote:
>>>> 
>>>> void TSEmergencyShutdown(const char *log_msg);
>>>> 
>>>> This API is a wrapper for the "Emergency" call, which signals
>>>> traffic_manager to not restart traffic_server after the shutdown, i.e. this
>>>> call should be used when something has gone wrong and cannot be recovered
>>>> by a restart.
>>> 
>> 
> 

Reply via email to