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

SocketProxy doesn't check if the port is already in use. #1141

Open
cryptobench opened this issue Jun 28, 2023 · 3 comments
Open

SocketProxy doesn't check if the port is already in use. #1141

cryptobench opened this issue Jun 28, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@cryptobench
Copy link
Member

Issue

While progressing with the development of the Golem portal, we stumbled upon an unexpected issue related to Socketproxy's port allocation.

We found that Yapapi permits the allocation of the same port to two instances of an identical script, without issuing any warning or error message. The lack of notification or exception on Yapapi's part was surprising, considering our expectation that it would raise some sort of alert in such situation.

Steps to Replicate:

  1. Open two terminal instances.
  2. In each terminal, run the same SSH example provided in the Yapapi examples.
image
@cryptobench cryptobench added the bug Something isn't working label Jun 28, 2023
@cryptobench
Copy link
Member Author

Update

The error is printed after shutting down the script, which doesn't seem intended.

image

@shadeofblue
Copy link
Collaborator

in this case, it's not really a problem with the library itself but with the code that starts the proxy - we'll update the example but you'd be responsible for updating the script you're using the SocketProxy in...

@cryptobench
Copy link
Member Author

in this case, it's not really a problem with the library itself but with the code that starts the proxy - we'll update the example but you'd be responsible for updating the script you're using the SocketProxy in...

Wouldn't it make more sense to hide away this check from the examples and instead put it inside the internals of yapapi as a type of Exception?

I would personally refrain from us having to add extra code in the examples to check if its in use or not. It's extra "bloat" for the eyes of new users, which could be hidden away.

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

No branches or pull requests

2 participants