Skip to content

apns sandbox connection crash #119

@simonxuhao

Description

@simonxuhao

Hi,

When my app starts, it creates both apns and apns sandbox connections, sometimes the sandbox connection crashes (exception exit: {in_closed,timeout}, see below), why is this happening? Will apns4erl recreate the connection? Should I add some code to handle connection lost?

=CRASH REPORT==== 21-Dec-2016::10:16:59 ===
crasher:
initial call: apns_connection:init/1
pid: <0.1939.0>
registered_name: myapp_apns_sandbox_conn
exception exit: {in_closed,timeout}
in function gen_server:terminate/7 (gen_server.erl, line 812)
ancestors: [apns_sup,<0.566.0>]
messages: []
links: [<0.567.0>,<0.1940.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 2586
stack_size: 27
reductions: 13755
neighbours:
neighbour: [{pid,<0.1940.0>},
{registered_name,[]},
{initial_call,{apns_queue,init,['Argument__1']}},
{current_function,{gen_server,loop,6}},
{ancestors,[myapp_apns_sandbox_conn,apns_sup,<0.566.0>]},
{messages,[]},
{links,[<0.1939.0>]},
{dictionary,[]},
{trap_exit,false},
{status,waiting},
{heap_size,233},
{stack_size,9},
{reductions,18}]

=SUPERVISOR REPORT==== 21-Dec-2016::10:16:59 ===
Supervisor: {local,apns_sup}
Context: child_terminated
Reason: {in_closed,timeout}
Offender: [{pid,<0.1939.0>},
{id,connection},
{mfargs,
{apns_connection,start_link,
[myapp_apns_sandbox_conn,
{apns_connection,"gateway.sandbox.push.apple.com",
2195,undefined,
"/etc/myapp/apns/dev_cert.pem",
undefined,undefined,undefined,30000,
#Fun<myapp_apns.handle_apns_error.2>,
"feedback.sandbox.push.apple.com",2196,
#Fun<myapp_apns.handle_apns_delete_subscription.1 >,
1800000,300,[],#Fun<error_logger.error_msg.2>,
#Fun<error_logger.info_msg.2>}]}},
{restart_type,transient},
{shutdown,5000},
{child_type,worker}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions