-
Notifications
You must be signed in to change notification settings - Fork 65
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
Stability on long run #85
Comments
WDA is designed to automatically restart every X amount of time. It is configured to every 4 hours by default. See https://github.com/DeviceFarmer/stf_ios_support/blob/master/coordinator/config.go#L208 stf_ios_provider shouldn't though also restart at that time. If it is restarting also that is a bug triggered by the automatic WDA restart. The code that handles the automatic restart is here: https://github.com/DeviceFarmer/stf_ios_support/blob/master/coordinator/periodic.go As can be seen in the code, if you configure the restart value to be 0 it will never restart. This causes problems though as WDA internally has memory leaks and it grows in size till it will crush your machine from memory use. That is why there is an automatic restart in the first place. Despite stf_ios_provider should not restart by itself, I don't see that it should hurt anything as long as it only happens when the automatic restart of WDA occurs. The problem though as you say is when it gets stuck in "preparing" mode. I've seen this happen because of the dependency on video streaming starting up correctly. The video is just too finicky and sometimes will not start up. There are various ways to "unstick" the video and get it working again but they don't happen automatically. Ultimately the fix for this is to use the new app based "upload broadcast extension" video streaming I have created. I have not yet released it though onto the app store as I've been working through how to set it up as a service... You might look into using the previous video mode based on quicktime_video_hack. Daniel Paulus says that he has fixed the issues with that, and it it more reliable than the default video method using AVFoundation. I haven't updated that method but it is still available as an option. If you set 'videoMethod' ( see here: https://github.com/DeviceFarmer/stf_ios_support/blob/master/coordinator/config.go#L162 ) to "ivp" instead of "avfoundation" the current code should still function the old way. The bug I was seeing though was that some phones simply don't work with the "ivp" method. If your phones do work with it, that method is more reliable ( for the most part ) than "avfoundation" is. Finally, the whole "stuck in preparing" is a "feature" of how STF itself works. It is somewhat garbage because it doesn't explain what is going on or why it is stuck. This is one of the various things I will fix entirely in my new closed source rewrite. |
Awesome! I tried before you replied; to increase the restart time for WDA and make it 24 hours; and it works with me so far ! although i didn't know how to relate this with the issue !
Do you mean that when WDA is restarting; we need also to make sure
waiting for your solution which will reduce the pain of the current solution issues! I will try also the |
Was supposed to say "stf_ios_provider shouldn't restart at that time" I've updated the post above to correct this. stf_ios_provider should stay running and continue to work. Will keep you posted on the app. I have it working currently, I just have two issues I need to resolve before I can release it:
Besides the app I do still intend to support the other video methods in my spare time. For anyone who wants a fully open source app based video streaming, I'll also just describe here how to do it. If some enterprising individual is willing to write it and open source it I'm happy to add it in as an option to stf_ios_support. It really wasn't that hard to make. I'm just not willing to release my implementation open source... because... reasons... Here is what one has to do to make the app:
So... someone else please write the above as open source to assist the community. Or don't and buy my rendition of it when I release it. 🤷 |
After WDA update to restart after 24h and watching the behavior, here is my findings:
The case as i observed will keep trying to trace and debug the case ! this is just a heads up |
I ran the following command to kill node processes while it is hang |
When it is stuck in the "preparing" state that is due to the device unit being "stuck" more so than the stf_ios_provider. Killing node processes will kill off both STF provider unit and STF IOS device unit. ( and they then in turn will be automatically started again by the coordinator ) You can also restart the device unit through the web interface on port 8027: https://github.com/DeviceFarmer/stf_ios_support/blob/master/coordinator/http_server.go The web interface provides a button to restart it. As a workaround / hack, it is possible to detect via API calls to STF when a device is stuck in the preparing state and then programmatically call the web restart REST call for the device unit. I considered doing this already but did not because I was hoping to discover what causes it to get stuck in the preparing state to begin with. |
you are correct; i found actually a workaround for this by restarting
and it works! though i still don't know what is the root cause; seems |
@mbilbiesi Are you able to connect 2 ios devices and stream them at a time? |
@uwtechexpert Yes; with the workaround I mentioned in the above comment #85 (comment) ; it is now working with me perfectly and have no issue since 1 month :) |
@mbilbiesi Hi, can I ask for a bit help from you? Can you provide a mini guide on how do you run ios and android devices on the same machine? If you have some time, contact to me, please [email protected] |
@illpe Asking for help on learning how to use STF isn't really what this thread or this repo is for. I'd appreciate if you didn't "at" commenters on issues here who you think may be able to solve your problems for you. In regard to your question of "how do you run ios and android devices on stf", the answer is:
The one main gotcha is that you must use https for your STF instance. I don't support using plain http with STF as the upstream guides tend to recommend. You can use my repo "stf-android-provider" to start an android provider to point at the STF instance that can be created using the "server/" folder in this repo. Please create a specific issue for your ask. I don't mind if you create issues that don't belong here. What I mainly mind is hijacking random issues and/or pestering other users of the repo. |
@mbilbiesi could you please to update the correct line for adding your block of code above? I've been tried adding your block of code according to the line you mentioned in coordinator.go but Updated! Thank you. |
Hello :)
After successfully running this app with two devices simultaneously; I have an issue with stability on long run !
The two iOS devices are disconnected and transitioned to
preparing
state as you can notice in the screenshot below:and i am attaching below
coordinator
logs from state after running the app !Based on the log; i see that it is
stf_ios_provider
restarted besidewdaproxy
; and whenever this happens; the process will restart; I believe there is an issue somewhere while restarting the process again !And i am trying to understand why the process keeps restarting !! I will keep looking into this behavior and post any findings! but if you also have any supportive suggestions on where i need to focus while am debugging ! it will be appreciated !
The text was updated successfully, but these errors were encountered: