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

[Port already bound Error] In the example zio-quickstart-restful-webservice, Pressing Ctrl-C blocks the port 8080 #2776

Closed
vivasvan1 opened this issue Apr 17, 2024 · 7 comments · May be fixed by zio/zio-quickstarts#58
Labels
💎 Bounty bug Something isn't working

Comments

@vivasvan1
Copy link

Describe the bug
In the example zio-quickstart-restful-webservice, Running sbt, then run and Pressing Ctrl-C blocks the port 8080

To Reproduce
Steps to reproduce the behaviour:

  1. Go to 'zio-quickstart-restful-webservice' repo
  2. Run sbt
  3. Type run and press enter
  4. Press Ctrl+C
  5. Now type run again and press enter
  6. See the Error.

Expected behaviour
Server.serve should be able to handle interuptions (like Ctrl+C)

Screenshots
image

Desktop (please complete the following information):

  • OS: Ubuntu
  • Browser N/A
  • Version 22.04

Additional context
n/a

@vivasvan1 vivasvan1 added the bug Something isn't working label Apr 17, 2024
@jdegoes
Copy link
Member

jdegoes commented Jun 5, 2024

/bounty $150

Copy link

algora-pbc bot commented Jun 5, 2024

💎 $150 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #2776 with your implementation plan
  2. Submit work: Create a pull request including /claim #2776 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to zio/zio-http!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟡 @varshith257 Jun 22, 2024, 6:11:25 PM #58

@kyri-petrou
Copy link
Collaborator

kyri-petrou commented Jun 7, 2024

@jdegoes @vivasvan1 AFAICT this is the intended behaviour, and it's not related to zio-http but with zio (see here).

The workaround is to add run / fork := true in the build.sbt file so that the server is shut down

@varshith257
Copy link
Contributor

varshith257 commented Jun 22, 2024

/attempt #2776

@kyri-petrou
Copy link
Collaborator

I'm closing this issue since it's not related to zio-http, although it'd be good if someone can create a PR in the zio-quickstart-restful-webservice repo as per my comment above

Copy link

algora-pbc bot commented Jun 29, 2024

@varshith257: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏

Copy link

algora-pbc bot commented Sep 13, 2024

💡 @varshith257 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 Bounty bug Something isn't working
Projects
None yet
4 participants