Upload
zarafa
View
2.606
Download
0
Embed Size (px)
DESCRIPTION
Presentation of Sebastian Kummer about debugging Z-Push at Zarafa SummerCamp 2011
Citation preview
Z-Push: advanced debuggingSebastian Kummer
Debugging Z-Push
Most of the time you don't see issues immediately!
Debugging is not that easy:
You need logs, they will be
What “usually” goes wrong – States Problems with states
• missing permissions• missing states after upgrading
States represent the synchronization state of mobile & folder on server
Missing states mean:• Server “does not know” what is already on the mobile, sends
EVERYTHING again → duplications on mobile• Some stuff (like sending, creating & editing items) “works” somehow• Could cause loops
In Z-Push 2 a mobile will be fully resynchronized when states are missing or invalid → missing states for many users could cause HIGH LOAD!
What “usually” goes wrong – Old versions
Old versions – especially 1.2.x and 1.3.x:• Compatibility issues
• Fields not being synchronized• Some invitations/recurrences broken (also with 1.4.x)
• Unimplemented features• Broken encodings - “Vielen Dank fÃŒr Ihre – Reservierung”
• Nokia issues (duplicated folders)
What “usually” goes wrong – Loops
Loops• Creating 1000000(0000000000) duplicates• High load on server• High use of mobile bandwidth (could $$$$)
Loops are nasty and dynamic! Requests are triggered BY THE MOBILE.
Most common causes:• Broken items (most of times calendar, e.g. recurrences)• Timeouts (server takes to long to process request)• Fatal errors or Apache/PHP Segfaults (rarely)• Incompatibilities (mobile tries over and over again)
Approaching loops - I
time
Mobile Server
Idle Has a change
Synch. request
Waits for answer
Idle
1. Reads state2. calculates delta3. exports change4. MAPI → ActiveSync5. streams change to mobile6. writes new state
Failure!
Any step (1-6) can fail!Any step could take to long!Segfault could occur!Connection could fail (entering tunnel?)
This is what you see in the log
TimeoutSEGFAULT
Retry
Approaching loops - II
time
Mobile Server
Idle Has a 'broken' change
Synch. request
Waits for answer
ERROR
1. Reads state2. calculates delta3. exports change4. MAPI → ActiveSync5. streams change to mobile6. writes new state
Success!
Faulty item is sent to the mobile!Mobile does not know how to interpret item → error!
Processes answer
This is what you see in the log – looks great!
Retry
Approaching loops - II
time
Mobile Server
Idle Has a 'broken' change
Synch. request
Waits for answer
ERROR
1. Reads state2. calculates delta3. exports change4. MAPI → ActiveSync5. streams change to mobile6. writes new state
Success!
Faulty item is sent to the mobile!Mobile does not know how to interpret item → error!
Processes answer
This is what you see in the log – looks great!
'Broken' ...?
Syntactical errors - Missing elementary properties, like subject - Missing start or end date of calendar item
Semantic errors - start date after end date - value not as expected (e.g. string vs. hex) - Recurrence exception: - missing/faulty basedate - not a recurrence at all (syntax)
Retry
'Kamikaze loop' - III
time
Mobile Server
Has NEW item Has a ('broken') change
Synch. request
Waits for answer
ERROR
1. Reads state2. creates item on server3. calculates delta4. exports changes5. MAPI → ActiveSync6. streams new ID 7. streams changes8. writes new state
Success/failure!
Anything after 2 fails..Anything else goes wrong (previous slides)
This is what you see in the log – looks great!
Retry
or timeout...
Doesn't reallymatter...
Kamikaze user
How an iPhone receives an email“ I can see the first lines of the mail in the preview, but when I open it
just says 'no body available'.....! “
time
iPhone Server
Idle Has a change
Synch. request
Fetch entire mail
Idle
Waits and processesSuccess
Retrieving and processing
Only 1K of plain email
ProcessingFailure
1. Retrieving 2. Processing as RFC822
Fetch with HTML
SEGFAULT
How to fix?
Error checking in loops• some syntax checking• only few semantics checks possible• Force lower maxItems
• Logging on user level • New log levels, incl. Deviceid (when synching several devices with same account
Questions?
Thank you for your attention!
More information at:http://z-push.sf.net/forumshttp://z-push.sf.net/trackerhttp://z-push.sf.net/downloadhttp://z-push.sf.net/compatibility
Contact: [email protected]