Open lbeschastny opened 10 years ago
I found a way to solve this problem for myself:
First, I'm creating my own event loop group:
(let [el (NioEventLoopGroup.)]
...
Then I'm calling feedback
wit this event loop group:
(feedback (dev-address) ctx :event-loop el)
Finally, I'm terminating event loop group after after processing the whole sequence of feedbacks:
(.shutdown el)
Here is the full code example:
(defn -main []
(let [store (ssl/keystore
:key-path (io/resource "my-project.p12")
:cert-path (io/resource "my-project.cer"))
tm (ssl/naive-trust-managers
:trace true)
ctx (ssl/ssl-context
:trust-managers tm
:keystore store)
el (NioEventLoopGroup.)]
(println "Fetching feedback...")
(doseq [[token timestamp] (feedback (dev-address) ctx :event-loop el)]
(println timestamp ":" token))
(println "Terminating...")
(.shutdownGracefully el)))
It looks like event loop continues to listen to some IO resource even after APNS connection is closed.
Probably, Netty leaves something in an event loop, which is not being cleaned up.
Hi.
I found another problem with
herolabs-apns
.After calling apns feedback service, it leaves some resource open (probably, some connection), thus preventing graceful termination of clojure process.
Here is my code to reproduce this problem: