Re: [os-libsynthesis] suspend failure

2010-03-16 Thread Lukas Zeller
Hello Patrick,

 It seems to me that the client gets confused here. If it cannot suspend,
 it should simply complete the session.

I agree with your diagnosis - if it is too late for a client to suspend it 
should terminate the session normally, and not do the kind of abort the log 
shows here.

There's IMHO one reason for too late - if the client is about to send the 
last message (final message of map phase), it does not make sense to request a 
suspend.

From the log snippets alone I can't see if it's really that case, but I guess 
so. Do you have complete HTML logs of this test case?

Most probably, there should be an extra check for that too late suspend.

 I'm a bit unsure about how to call SessionStep() after asking for a
 suspend. I think we observed that it was waiting for the server reply,
 so we call it with GOTDATA. The sequence is this (before is what is
 passed to the function, after what it sets):

STEPCMD_SUSPEND is an out of order step, and can be issued anywhere in 
between. It always returns STEPCMD_OK. After issuing a STEPCMD_SUSPEND, you 
should continue stepping exactly as if the STEPCMD_SUSPEND had never happened. 
There's a note on this in engine_defs.h:249, but probably also should be 
mentioned in the SDK docs.

Best Regards,

Lukas


On Feb 26, 2010, at 14:58 , Patrick Ohly wrote:

 Hello!
 
 I'm testing suspend/resume between SyncEvolution as client and as
 server. Our test suite contains a test which runs different sync
 scenarios and asks to suspend on the client side before processing each
 server reply, at all those positions (before first reply, second, etc.).
 
 I notice that it fails when the client suspends before processing the
 second-to-last server reply (in other words, before the final message
 from the client to the server).
 
 I'm attaching that client log. What I see is this (initial messages from
 SyncEvolution):
 
  * [2010-02-26 13:56:21.885] UserSuspendInjector: user suspend
after getting reply #2
  * [2010-02-26 13:56:21.885] suspending before SessionStep() in
STEPCMD_GOTDATA as requested by user
  * [2010-02-26 13:56:21.885] --- Ignoring all commands in
this message (after 1 sec. request processing, 1 sec. total) with
Status 514 (0=none) from here on
  * [2010-02-26 13:56:21.885] WARNING: Session locally flagged for
suspend, reason=20032
  * [2010-02-26 13:56:21.885] suspending before SessionStep() in
STEPCMD_GOTDATA as requested by user
  * [2010-02-26 13:56:21.885] engine already notified of suspend
request, reverting to STEPCMD_GOTDATA
 ...
 * [2010-02-26 13:56:21.888] Outgoing WBXML message msgID=4 saved as XML
 translation
 ...
 * [2010-02-26 13:56:21.889] Warning: Failed with status code=0,
 statistics are incomplete!!
 ...
 * [2010-02-26 13:56:21.889] Session not any more in progress:
 NextMessage() returns OK status=0
  * [2010-02-26 13:56:21.889] forgetChangeLog: DISCARDING already loaded
changelog with 7 entries
  * [2010-02-26 13:56:21.890] DeleteContext
  * [2010-02-26 13:56:21.890] TSyncSession::TerminateSession: calling
InternalResetSession
  * [2010-02-26 13:56:21.890] Never received status for command
'SyncHdr', (outgoing MsgID=4, CmdID=0)
  * [2010-02-26 13:56:21.890] Deleted command 'SyncHdr' (outgoing
MsgID=4, CmdID=0)
 
 That last outgoing message is also attached. It does *not* contain a
 request to suspend, but the client seems to think that is has suspended.
 It does not save its anchors. The server sees that last message and
 completes its session normally, saving the next client anchor. In the
 following session, the client anchor mismatch forces a slow sync.
 
 It seems to me that the client gets confused here. If it cannot suspend,
 it should simply complete the session.
 
 I'm a bit unsure about how to call SessionStep() after asking for a
 suspend. I think we observed that it was waiting for the server reply,
 so we call it with GOTDATA. The sequence is this (before is what is
 passed to the function, after what it sets):
 
 * [2010-02-26 14:51:26.073] after SessionStep: STEPCMD_NEEDDATA
  * [2010-02-26 14:51:26.073] UserSuspendInjector: user suspend after
getting reply #2
  * [2010-02-26 14:51:26.073] suspending before SessionStep() in
STEPCMD_GOTDATA as requested by user
  * [2010-02-26 14:51:26.073] before SessionStep: STEPCMD_SUSPEND
  * [2010-02-26 14:51:26.073] --- Ignoring all commands in
this message (after 1 sec. request processing, 1 sec. total) with
Status 514 (0=none) from here on
  * [2010-02-26 14:51:26.073] WARNING: Session locally flagged for
suspend, reason=20032
  * [2010-02-26 14:51:26.073] after SessionStep: STEPCMD_OK
  * [2010-02-26 14:51:26.073] suspending before SessionStep() in
STEPCMD_GOTDATA as requested by user
  * [2010-02-26 14:51:26.074] engine already notified of suspend
request, reverting to STEPCMD_GOTDATA
  * [2010-02-26 14:51:26.074] before SessionStep: STEPCMD_GOTDATA
  * [2010-02-26 

Re: [os-libsynthesis] suspend/resume + datastore + tokens

2010-03-16 Thread Patrick Ohly
On Fr, 2010-02-26 at 15:12 +, Patrick Ohly wrote:
 Hello!
 
 When we started with SyncEvolution, we discussed the StartDataRead()
 resumeToken parameter. At that time, we came to the conclusion that a
 binfile based client doesn't have to distinguish between different
 tokens. Always reporting the changes since the last sync is good enough,
 the binfile layer takes care of merging the recent changes with those
 that haven't been sent.
 
 Now, on the server side I think tokens are relevant, right?
 SyncEvolution as server doesn't support multiple tokens yet, and I was
 hoping that one of the existing tests would fail because of that, but no
 luck so far. I found two problems (see other emails), but none that I
 could attribute to SyncEvolution ;-}
 
 In which situation on the server side is the distinction between
 lastToken and resumeToken relevant?

I discussed this with Lukas. Here's my write up of the answer:
http://bugzilla.moblin.org/show_bug.cgi?id=2425#c5


(In reply to comment #4)
  True. However, I learned in the meantime that the binfile support is not
  enabled for SyncML servers. Once we turn SyncEvolution also into a server, 
  we
  need to revisit this issue.
 
 ... so now we need to solve this issue. Without it, our suspend/resume tests
 against our own server should fail.

Only in some very constructed situation, and one which is not currently covered
by any of our tests. Here's where the two anchors make a difference:
1. client and server in sync
2. item added on server
3. client and server sync
4. suspend after sending that new item to client
5. a second item added on server
5.1 resume = send changes since step 4
5.2 two-way sync instead of resume,
using anchors from step 1 = send changes since
step 1

Our server fails in 5.2, because it will always only send changes since the
last sync (step 4 in this example).

The relevance of this is debatable. It depends on clients actually being able
to roll back to a previous state. Our own client can't do that, so it would
have to do a slow sync in 5.2 instead of resuming.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.



___
os-libsynthesis mailing list
os-libsynthesis@synthesis.ch
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis