apns4erl icon indicating copy to clipboard operation
apns4erl copied to clipboard

apns sandbox connection crash

Open simonxuhao opened this issue 8 years ago • 0 comments

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}]

simonxuhao avatar Dec 21 '16 02:12 simonxuhao