Git Product home page Git Product logo

Comments (7)

bketelsen avatar bketelsen commented on June 23, 2024

why do you have two different ports listening? Looks like 666 and 667?

from captainhook.

analytically avatar analytically commented on June 23, 2024

I'm running CaptainHook on Docker with autorestart=true. So to be able to run CaptainHook in multiple containers on the same machine with --net=host Docker, I use

#!/bin/bash

increment=${CAPTAINHOOK_PORT_INCREMENT:-1}
port=${CAPTAINHOOK_PORT:-666}

isfree=$(netstat -tapln | grep $port)
while [[ -n "$isfree" ]]; do
  port=$[port+increment]
  isfree=$(netstat -tapln | grep $port)
done

exec /usr/share/gocode/bin/captainhook -listen-addr 127.0.0.1:$port -configdir /etc/captainhook -echo

Hence the 2014/09/29 19:27:13 Listening on 127.0.0.1:667 line.

from captainhook.

analytically avatar analytically commented on June 23, 2024

So basically, I think this goes like: bind to 666, crash without releasing the bind, bind on 667.

from captainhook.

analytically avatar analytically commented on June 23, 2024

PS this is on Ubuntu 14.04 using Go 1.2.1.

from captainhook.

bketelsen avatar bketelsen commented on June 23, 2024

It's deadlocked because the port is in use. Your incrementing script might have a bug?

from captainhook.

analytically avatar analytically commented on June 23, 2024

Hmm this is running on a machine with only one Docker container running, so the port wasn't in use. I can also see that by the 2014/09/29 19:27:13 Listening on 127.0.0.1:666 line. If the port was in use, it would not have bound to it.

from captainhook.

bketelsen avatar bketelsen commented on June 23, 2024

it didn't bind to it, that's line 34 in your stack trace. Go is waiting for that port to be freed.

from captainhook.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.