-
Notifications
You must be signed in to change notification settings - Fork 195
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
HouseArrestService BUG #1115
Comments
Doesn't using it in a context-manager solve all? Sounds like you forgot to close the resource |
Look at this |
After simplification
|
So what I'm talking about is that when the UIFileSharingEnabled is not enabled |
I'm sorry but I'm failing to understand your claim. Did you refactor your code to use a context-manager or did you not? If you did not, the service socket will remain open which could explain your bug. I don't understand what other behavior you would expect |
UIFileSharingEnabled is not enabled |
Oh, so you mean the socket remains open till python's GC closes it because the object cannot be created in the first place? |
··· |
You could simply answer my question. |
Python will recycle but Apple has a bug that will prohibit connections if too many services are connected |
Sounds like a simple |
yes |
limited number of connections. |
Or remove |
I prefer the |
Yes, so please fix it. |
house_arrest: trigger `close()` when failing in ctor (#1115)
You can't write like this |
And why not use del to ensure that it is closed when recycled? |
Overriding |
Because the service has been shut down. |
|
house_arrest: trigger `close()` only upon error (#1115)
So what about this?
|
Test environment
Describe the bug
HouseArrestService, when initializing, calls the send_command function by default. When the application is unreadable, it triggers
pymobiledevice3.exceptions.PyMobileDevice3Exception: InstallationLookupFailed.
However, the connection is not closed, which will cause the HouseArrestService to be prohibited from creating further connections after approximately 300~600 failures due to too many connections, necessitating a device restart.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Even if an error occurs, the service should be closed in time
Logs
Connection forbidden Error log
Additional context
For community
⬇️ Please click the 👍 reaction instead of leaving a
+1
or 👍 commentThe text was updated successfully, but these errors were encountered: