Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[commandline] servers seem not to block waiting for connections #85

Open
imalsogreg opened this issue Apr 27, 2016 · 8 comments
Open

[commandline] servers seem not to block waiting for connections #85

imalsogreg opened this issue Apr 27, 2016 · 8 comments

Comments

@imalsogreg
Copy link
Contributor

I'm working on the commandline branch. A simple example server such as the one below prints the typical snap startup info to stdout, and then the process immediately ends without writing anything to access.log or error.log:

main = quickServe (writeText "hello")

Steps to reproduce:

  1. git clone [email protected]:imalsogreg/snap
  2. cd snap
  3. git checkout origin/fallthrough
  4. git submodule update --init --recursive
  5. ./init-sandbox.sh
  6. cabal install --only-dep
  7. cabal build
  8. dist/build/demo/demo -p 8000
@mightybyte
Copy link
Member

This wouldn't be that old clock issue that you discovered would it? If so, since there is now a fixed version available, we should definitely add a constraint to leave out the offending versions.

@imalsogreg
Copy link
Contributor Author

👍 for some constraints than exclude (clock >= 0.5.2 && < 0.7). I don't think that is the issue here though. My clock is at v0.5.1.

@mightybyte
Copy link
Member

Just thinking about this a little more...does the issue happen on the master branch? That could help in tracking it down.

@imalsogreg
Copy link
Contributor Author

The same simple program main = quickHttpServe (writeText $ pack "Hello") runs as usual on the master branch.

@mightybyte
Copy link
Member

Does the test suite pass on the commandline branch? Based on the nature of your report here, I would hope the test suite is failing.

@imalsogreg
Copy link
Contributor Author

Snap testsuite:

I had to update the test suite a little to match the new types in commandline.

Testsuite fails many of the hspec cases with (Connection refused) errors (consistent with the server not staying up long enough to do anything).

snap-server testsuite:

commandline branch: all green! (second file in this gist

@sopvop
Copy link
Contributor

sopvop commented Apr 29, 2016

I think the problem is in this being a maybe monad and this not setting port. Can't check this myself right now, unfortunately.

@imalsogreg
Copy link
Contributor Author

@sopvop Thanks for the lead. Based on that, I tried explicitly setting the default port here to Just 8000. This does causes a port to be picked by default, but doesn't prevent the fallthrough. Also - choosing a port at runtime with the -p 8001 flag, 8001 makes it all the way through and snap does start up on that port - it just doesn't stay up.

Hmm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants