-
Notifications
You must be signed in to change notification settings - Fork 48
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
Network scan of some subnets time out on Ubuntu 22.04.2 #130
Comments
This is a very detailed report, thank you. This will likely take some digging, @jameshilliard any initial thought? |
@martyfay1 would you mind sharing what that IP is? |
I've made some changes on the |
I've tried with that branch and it still fails. I'll get back to you on what that IP is. |
This has happened on 2 subnets. In both cases, the IPs correspond to a miner in a bad state. Nothing on it is responsive. The miners are S19J Pro running bitmain firmware Mon Dec 26 17:19:30 CST 2022. |
Ok interesting. That makes a lot more sense, I had thought maybe somehow the IP address itself was killing the request, but if it's an unresponsive miner that's a lot different. It's likely just not handling a read timeout properly. |
Do you have any suggestion for how I can mitigate this from delaying the whole scan when done on Linux? I don't want potentially one bad miner to harm scan performance... |
I don't have any ideas yet, we're testing some things, I'm sure it can be fixed here in the library, but I just have to figure out what is actually freezing for that long and why. |
Seems like its hanging up somewhere in this function in httpcore -
Any change you can run a debug python handler and see if you can find where it gets stuck? Github Permalink - https://github.com/encode/httpcore/blob/39b756f07d40fab4eccb7c0dd3d7d369f1d2b4e8/httpcore/_async/http11.py#L245-L257 |
I agree that it is getting stuck at that function. I am having a hard time figuring out how to debug it since it is on a server. I ran it with the |
Maybe something like this? https://stackoverflow.com/questions/543196/how-do-i-attach-a-remote-debugger-to-a-python-process |
Hey so I spent a little more time working with the pdb. It hangs after the await sleep(0) call at site-packages/anyio/_backends/_asyncio.py(1192), because |
Can you try this at the start of the program? Curious if killing the connections with
|
Set the linger to 0, same problem still. |
I'm stumped on this one. You might just want to play around with the |
Added an |
Still the scan takes ~100 seconds longer then it should. I've tried many things, like setting timeouts on the get request and what seems to happen is that the get request knows it needs to timeout after a certain time, say 5 seconds, and starts to close the request then, but the actual closing of the socket takes ~100 seconds. When trying to call a get request from the command line ie.
If not including the -m 10 arguments, it will also take ~100 seconds to time out when the connection is reset by peer. Not sure if this helps at all but I couldn't figure it out from here.
|
The last thing I can think of here before I try to take this to httpx is that it's possibly an issue with an older version of python? Have you tried on the mac with the same python version you have on the Ubuntu device? |
I just made sure, version 3.12.3 on the mac, and I upgraded from 3.12.2 to 3.12.3 on ubuntu and still experiencing the same issue. |
Started a discussion in httpx, we shall see. |
I had a similar problem. I solved it by editing the config. |
the bug is observed before the version 0.40.5 I am using the nmap scanner bypassing the built-in scanner |
Describe the bug
When making a network from a subnet and then calling
network.scan()
on certain subnets, it will timeout and fail based on a singular ip being present in the subnet. When that ip is removed from the subnet, (by usingMinerNetwork.from_list()
and supplying all of the ips except the specific one) it works fine. The thing is that on macOS 13.6.6 it works fine even with that ip included.I've traced the issue of the bug to the
_get_miner_web()
call, and more specifically the_web_ping()
call with the urlf"http://{ip}/"
. When examining the logs for the from thehttpx.AsyncClient.get()
call, theIt starts hanging on the
response_closed.started
line for around 100 seconds, before failing. On mac, this get request response closes without timeout of the scan.The only difference I see is that on mac, the same logs show socket_options=[(65535, 128, b'\x01\x00\x00\x00\xe8\x03\x00\x00')]
Expected behavior
The http get request should fail without disrupting the scan.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: