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

The coverage of SDLBackgroundTaskManager is not enough #1326

Closed
t-yoshii opened this issue Jul 1, 2019 · 5 comments
Closed

The coverage of SDLBackgroundTaskManager is not enough #1326

t-yoshii opened this issue Jul 1, 2019 · 5 comments
Assignees
Labels
bug A defect in the library
Projects

Comments

@t-yoshii
Copy link

t-yoshii commented Jul 1, 2019

Bug Report

The new SDLBackgroundTaskManager stops background task when transport is connected.

We found that RAI is not sent because the app become Suspended before sending RAI. App does not wakeup anymore because no message will be sent from SDL Core.

Also, SDLBackgroundTaskManager does not start background task when it receives a data from EA session, is it OK?
Till v6.2.3, SDLIAPTransport start background task when it receives data.
https://github.com/smartdevicelink/sdl_ios/blob/6.2.3/SmartDeviceLink/SDLIAPTransport.m#L640

Jul  1 10:56:53 iPhoneSE-M00235 CTSMediaApp1_ms(SmartDeviceLink)[257] <Notice>: 10:56:53:390 \M-p\M^_\M^T\M-5 (SDL)Lifecycle:SDLLifecycleManager:709 - Transport connected
// Background task ended
Jul  1 10:56:53 iPhoneSE-M00235 CTSMediaApp1_ms(SmartDeviceLink)[257] <Notice>: 10:56:53:390 \M-p\M^_\M^T\M-5 (SDL):SDLBackgroundTaskManager:57 - Ending background task with id: 11
Jul  1 10:56:53 iPhoneSE-M00235 CTSMediaApp1_ms(SmartDeviceLink)[257] <Notice>: 10:56:53:390 \M-b\M^Z\M-* (SDL)Utilities:SDLStateMachine:84 - State machine for class SDLLifecycleManager will transition from state Started to state Connected
Jul  1 10:56:53 iPhoneSE-M00235 CTSMediaApp1_ms(SmartDeviceLink)[257] <Notice>: 10:56:53:391 \M-b\M^Z\M-* (SDL)Protocol:SDLProtocol:280 - Send RPC RegisterAppInterface (request)
// Proxy tries to send data, however, this RAI is not received at SDL Core.
Jul  1 10:56:53 iPhoneSE-M00235 CTSMediaApp1_ms(SmartDeviceLink)[257] <Notice>: 10:56:53:392 \M-b\M^Z\M-* (SDL)Protocol:SDLProtocol:343 - Sending protocol message: Version:5, encrypted:0, frameType:Single(1), serviceType:7, frameData:Reserved(0), sessionID:1, dataSize:558, messageID:1  RPC Info: RegisterAppInterface Request
Jul  1 10:56:53 iPhoneSE-M00235 assertiond[66] <Notice>: [CTSMediaApp1_ms:257] Deactivate assertion: <BKProcessAssertion: 0x10fd345d0; "com.sdl.transport.backgroundTask" (finishTask:180s); id:\M-b\M^@\M-&C0EE4CEE27BB>
Jul  1 10:56:53 iPhoneSE-M00235 assertiond[66] <Notice>: [CTSMediaApp1_ms:257] no more active assertions, resetting _timedAssertionPermittedDuration, _timedAssertionReferenceTime, _timedAssertionDeadlineActive: NO
Jul  1 10:56:53 iPhoneSE-M00235 assertiond[66] <Notice>: [CTSMediaApp1_ms:257] New process assertion state; (none) (assertion 0x10fd345d0 added: (none); removed: preventSuspend, preventIdleSleep, preventSuspendOnSleep)
Jul  1 10:56:53 iPhoneSE-M00235 assertiond[66] <Notice>: [CTSMediaApp1_ms:257] suspend success
Jul  1 10:56:53 iPhoneSE-M00235 assertiond[66] <Notice>: [CTSMediaApp1_ms:257] Setting jetsam priority to 0 [0]
Jul  1 10:56:53 iPhoneSE-M00235 assertiond[66] <Notice>: [CTSMediaApp1_ms:257] pid_shutdown_sockets(1) success
Jul  1 10:56:53 iPhoneSE-M00235 assertiond[66] <Notice>: Releasing PowerAssertion on CTSMediaApp1_ms:257 from update
Jul  1 10:56:53 iPhoneSE-M00235 assertiond[66] <Notice>: [CTSMediaApp1_ms:257] Remove assertion: <BKProcessAssertion: 0x10fd345d0; "com.sdl.transport.backgroundTask" (finishTask:180s); id:\M-b\M^@\M-&C0EE4CEE27BB>
Jul  1 10:56:53 iPhoneSE-M00235 SpringBoard[55] <Notice>: Application process state changed for UIEvolution.Media-Test-App: <SBApplicationProcessState: 0x1c0c28de0; pid: 257; taskState: Suspended; visibility: Background>
    ACCPlatformApplicationStateProcessIDKey = 257;
    ACCPlatformApplicationStateProcessIDKey = 257;
Jul  1 10:56:53 iPhoneSE-M00235 mediaserverd(CoreMedia)[27] <Notice>: -CMSessionMgr- CMSessionMgrHandleApplicationStateChange: CMSession: Client UIEvolution.Media-Test-App with pid '257' is now Background Suspended. Background entitlement: YES
Jul  1 10:56:53 iPhoneSE-M00235 mediaserverd(AudioToolbox)[27] <Notice>: 3351: { "action":"application_state_changed", "session":{"ID":"0x1b063","PID":257,"name":"CTSMediaApp1_ms","type":"Fig"}, "details":{"new_state":"Background Task Suspended"} }
Jul  1 10:56:53 iPhoneSE-M00235 mediaserverd(AudioToolbox)[27] <Notice>: 1170: pid 257(CTSMediaApp1_ms)
Jul  1 10:56:53 iPhoneSE-M00235 mediaserverd(AudioToolbox)[27] <Notice>: 3351: { "action":"application_state_changed", "session":{"ID":"0x1b060","PID":257,"name":"CTSMediaApp1_ms"}, "details":{"new_state":"Background Task Suspended"} }
Jul  1 10:56:53 iPhoneSE-M00235 powerd[36] <Notice>: Process assertiond.66 Released NoIdleSleepAssertion "CTSMediaApp1_ms:257:257-6E9F34BE-A081-40D9-8D1A-C0EE4CEE27BB [com.sdl.transport.backgroundTask] [0x10fd345d0]" age:00:00:32  id:4295000956 [System: PrevIdle]
Jul  1 10:56:53 iPhoneSE-M00235 symptomsd(SymptomEvaluator)[123] <Notice>: 257 UIEvolution.Media-Test-App: BackgroundTaskSuspended (most elevated: BackgroundTaskSuspended)
Reproduction Steps
  1. Repeadedly connect and disconnect SDL apps in background.
Expected Behavior
  1. SDL app registers
Observed Behavior
  1. SDL app fails to register
OS & Version Information
  • iOS Version: iOS11, iPhone SE
  • SDL iOS Version: 6.3.0
  • Testing Against: Our internal devboard
Test Case, Sample Code, and / or Example App

none

@NicoleYarroch
Copy link
Contributor

@t-yoshii Does PR #1333 fix this issue for you?

@t-yoshii
Copy link
Author

@NicoleYarroch Thanks. We will test the fix #1333

@theresalech
Copy link
Contributor

@t-yoshii have you been able to confirm the fix? We'd like to move forward with releasing the hotfix as soon as possible. Thanks!

@t-yoshii
Copy link
Author

Hi @theresalech @NicoleYarroch ,

Thanks for the ping. We are running the repeat test, so, please give us some more time.

So far, It seems connection stability is greatly improved by this fix!. However, some connection failures are observed. So I am also analyzing these issues.

@t-yoshii
Copy link
Author

Hi @theresalech @NicoleYarroch,

We tried to reproduce above issues, however, it did not reproduce after >100 attempts. So we think the above failures were temporary problems.

Please merge #1333.
We appreciate your efforts on the connection stability improvement since v6.2.0.

Thanks.

v6.3.1 automation moved this from To do to Done Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the library
Projects
No open projects
v6.3.1
  
Done
Development

No branches or pull requests

4 participants