Clojurians
#pedestal
<
2016-05-16
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

donaldball19:05:21

Hey folks, I’m running into a minor hurdle migrating a pedestal project to use component for system state

donaldball19:05:37

(defrecord Pedestal [service]
  component/Lifecycle
  (start [this]
    (let [server (-> service http/create-server http/start)]
      (assoc this ::server server)))
  (stop [this]
    (http/stop (::server this))
    (dissoc this ::server)))

donaldball19:05:13

That’s my bog-standard component (http being io.pedestal.http). It starts and stops fine once, but fails to restart thereafter, claiming:

donaldball19:05:25

2016-05-16 14:56:10.754-0400 ERROR org.apache.coyote.http11.Http11NioProtocol Failed to initialize end point associated with ProtocolHandler ["http-nio-8080"]
java.net.BindException: Address already in use

donaldball19:05:49

FWIW this seems to be specific to the tomcat server type, so plausibly is a bug

donaldball19:05:40

I kinda like the design, but the docs are laughable, and the registration process for interceptors seems haphazard