Re: [fossil-users] Cloning repo

2014-10-06 Thread Jacek Cała
Stephan, Andy,

Thanks for the quick action re my issue. I'll test it as soon as I have a
little more time (end of this week?).

  Best,
  Jacek


2014-10-06 16:23 GMT+01:00 Stephan Beal :

> On Mon, Oct 6, 2014 at 6:24 AM, Andy Bradford 
> wrote:
>
>> After looking  at it, I  don't think  this introduces any  unwanted side
>> effects.
>
>
> :-D
>
>
>> autosync-tries dictates  how  many  times ``autosync''  should
>> ...autosync-tries would be honored and one would have to enter the
>> password
>> for a maximum of 2 * autosync-tries.
>>
>
> That's what it looked like to me. Potentially annoying but harmless (and
> abortable with a Ctrl-C).
>
>
>
>> Maybe  if  we  could  distinguish between  password  failure  and  other
>> 
>>
>
> Seems to me to be rare corner case which isn't necessary. Maybe in certain
> setups/uses, but i can't say i'd ever conceived of this "problem" until
> Jacek (the OP) posted it.
>
>
>> For the archives, here is what happens when I have autosync-tries set to
>> 2 and a password failure:
>> ...
>> Autosync failed.
>> continue in spite of sync failure (y/N)? n
>> $
>>
>> Seems to behave as I would expect.  Any other opinions?
>>
>
> Agreed. No "less surprising" result for that case comes to mind.
>
> But now that you mention autosync retry count... i'm not 100% sure i put
> that ++nErrs in the right place:
>
>
> http://www.fossil-scm.org/index.html/info/165cc5c093e6ee36a78de5e01f7049235dbc1b1c?ln=1856-1867
>
> Could i convince you to give that look?
>
>
> --
> - stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
> "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
> those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
>
> ___
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>
>
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Cloning repo

2014-10-06 Thread Andy Bradford
Thus said Stephan Beal on Mon, 06 Oct 2014 17:23:22 +0200:

> http://www.fossil-scm.org/index.html/info/165cc5c093e6ee36a78de5e01f7049235dbc1b1c?ln=1856-1867
> 
> Could i convince you to give that look?

Yes, I'll  look at it  again later. I looked  at it briefly  before just
long enough to remind myself of where it was relevant and didn't see any
obvious problems. I couldn't seem to  produce any problems either, but I
really only tried  it with sync and not clone  operations. I believe the
only time it  will be relevant for  a clone operation is  the very first
sync operation.

Andy
--
TAI64 timestamp: 40005432f0e7
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Cloning repo

2014-10-06 Thread Stephan Beal
On Mon, Oct 6, 2014 at 6:24 AM, Andy Bradford 
wrote:

> After looking  at it, I  don't think  this introduces any  unwanted side
> effects.


:-D


> autosync-tries dictates  how  many  times ``autosync''  should
> ...autosync-tries would be honored and one would have to enter the password
> for a maximum of 2 * autosync-tries.
>

That's what it looked like to me. Potentially annoying but harmless (and
abortable with a Ctrl-C).



> Maybe  if  we  could  distinguish between  password  failure  and  other
> 
>

Seems to me to be rare corner case which isn't necessary. Maybe in certain
setups/uses, but i can't say i'd ever conceived of this "problem" until
Jacek (the OP) posted it.


> For the archives, here is what happens when I have autosync-tries set to
> 2 and a password failure:
> ...
> Autosync failed.
> continue in spite of sync failure (y/N)? n
> $
>
> Seems to behave as I would expect.  Any other opinions?
>

Agreed. No "less surprising" result for that case comes to mind.

But now that you mention autosync retry count... i'm not 100% sure i put
that ++nErrs in the right place:

http://www.fossil-scm.org/index.html/info/165cc5c093e6ee36a78de5e01f7049235dbc1b1c?ln=1856-1867

Could i convince you to give that look?


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Cloning repo

2014-10-05 Thread Andy Bradford
Thus said Stephan Beal on Sat, 04 Oct 2014 21:36:33 +0200:

> If  you  suspect  this  change  may  have  unwanted  side  effects  on
> other  (non-clone)  client_sync()-using  routines, please  voice  your
> suspicions!

After looking  at it, I  don't think  this introduces any  unwanted side
effects.  autosync-tries dictates  how  many  times ``autosync''  should
try,  not how  many password  attempts  will occur  during those  tries.
The  default is  1  (historic behavior)  which means  you  will only  be
prompted 2 times  for a password. I would expect  with an autosync-tries
value  greater than  1 that  even in  the event  of a  password failure,
autosync-tries would be honored and one would have to enter the password
for a maximum of 2 * autosync-tries.

Maybe  if  we  could  distinguish between  password  failure  and  other
failures, it  might be conceivable  and arguable to  make autosync-tries
abort early, but I don't think it's really necessary. Most use cases for
incrementing  autosync-tries centered  on  the need  to  avoid forks  by
having  autosync retry  more  than  once. Having  it  honored even  when
password failures happen  means that the user could  potentially ask the
admin for the  correct password before continuing and  thus avoiding the
dreaded ``Autosync failed. continue in spite of sync failure (y/N)?''

For the archives, here is what happens when I have autosync-tries set to
2 and a password failure:

$ f set autosync-tries 2
$ f ci -m three 
Autosync:  http://tester@remote:8080/
Round-trips: 1   Artifacts sent: 0  received: 0
Error: login failed
password for tester: 
Round-trips: 2   Artifacts sent: 0  received: 0
Error: login failed
password for tester: 
Round-trips: 3   Artifacts sent: 0  received: 0
Error: login failed
Round-trips: 3   Artifacts sent: 0  received: 0
Pull finished with 1019 bytes sent, 867 bytes received
Autosync failed, making another attempt.
Autosync:  http://tester@remote:8080/
Round-trips: 1   Artifacts sent: 0  received: 0
Error: login failed
password for tester: 
Round-trips: 2   Artifacts sent: 0  received: 0
Error: login failed
password for tester: 
Round-trips: 3   Artifacts sent: 0  received: 0
Error: login failed
Round-trips: 3   Artifacts sent: 0  received: 0
Pull finished with 1020 bytes sent, 867 bytes received
Autosync failed.
continue in spite of sync failure (y/N)? n
$

Seems to behave as I would expect.  Any other opinions?

Andy
-- 
TAI64 timestamp: 400054321989


___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Cloning repo

2014-10-05 Thread Andy Bradford
Thus said Stephan Beal on Sat, 04 Oct 2014 21:36:33 +0200:

> Before  this  change  autosync_loop() did  not  consider  login-prompt
> failure to be an  error. This seems to be an  unusual corner case, and
> i'm not sure which behaviour (old or new) is optimal for this case.

Thanks for tracking this  down. I'll take a look at  the changes and see
if there is something that can be done better in this case.

Thanks,

Andy
-- 
TAI64 timestamp: 4000543192ac


___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Cloning repo

2014-10-04 Thread Stephan Beal
On Sat, Oct 4, 2014 at 9:22 PM, Stephan Beal  wrote:

> Management summary: fixed now:
>
>
> http://www.fossil-scm.org/index.html/info/334d7744021dba7be0a34d88aacb32a9a4860291
>


The cause was that the password prompt did not consider the 3rd failure to
> be an error,
>

Correction: second password-prompt failure is treated as an error.

@Other devs:

i see one potentially unwanted side-effect of this in autosync_loop(): it
will treat each client_sync()-level failure (which includes 2 password
prompt attempts) as a single failure, meaning that the semantics of "number
of retries" is subtly... not necessarily wrong, but possibly arguable. Each
2 password fails is counted as one error for purposes of autosync_loop(),
meaning that a (set of) password prompt login error(s) will now be picked
up by autosync_loop(), where that case was effectively ignored before.
Before this change autosync_loop() did not consider login-prompt failure to
be an error. This seems to be an unusual corner case, and i'm not sure
which behaviour (old or new) is optimal for this case.

If you suspect this change may have unwanted side effects on other
(non-clone) client_sync()-using routines, please voice your suspicions!

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Cloning repo

2014-10-04 Thread Stephan Beal
On Sat, Oct 4, 2014 at 9:55 AM, Stephan Beal  wrote:

> It is by design, and is a long-standing behaviour, but whether it's truly
> required to be so (in terms of the internals), i don't know off-hand. Will
> look at whether it's easy to get around that when i get back in town this
> evening.
>

Okay, it wasn't quite the scenario i thought it was - fossil used to leave
empty db files in other cases but that seems to have been resolved since i
last saw it.

Management summary: fixed now:

http://www.fossil-scm.org/index.html/info/334d7744021dba7be0a34d88aacb32a9a4860291

Details...

The cause was that the password prompt did not consider the 3rd failure to
be an error, which caused the higher-level clone operation to think that
everything was OK, which left an empty (but apparently valid) repo db
laying around. That doesn't happen with the above change:

[stephan@host:~/cvs/fossil]$ f clone
http://MyFakeUser:wrongpassw...@egenome-fossil.cloudapp.net/e-Genome x.fsl
remember password (Y/n)?
Round-trips: 2   Artifacts sent: 0  received: 0
Error: login failed
password for MyFakeUser:
Round-trips: 3   Artifacts sent: 0  received: 0
Error: login failed
Round-trips: 3   Artifacts sent: 0  received: 0
Clone finished with 907 bytes sent, 865 bytes received
server returned an error - clone aborted
[stephan@host:~/cvs/fossil]$ l x.fsl
ls: cannot access x.fsl: No such file or directory

Before this change the above test ended with:

...
Clone finished with 910 bytes sent, 862 bytes received
Rebuilding repository meta-data...
  100.0% complete...
project-id: 0f5ea9d3c8bb48d8de1f1075b62026a6c7538d1e
server-id:  e1d973f1e613b856d9976185936e3601901bf804
admin-user: MyFakeUser (password is "fdc42f")
[stephan@host:~/cvs/fossil]$ l x.fsl
-rw-r--r-- 1 stephan stephan 58368 Oct  4 21:12 x.fsl
[stephan@host:~/cvs/fossil]$ f-timeline -R x.fsl




-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Cloning repo

2014-10-04 Thread Stephan Beal
It is by design, and is a long-standing behaviour, but whether it's truly
required to be so (in terms of the internals), i don't know off-hand. Will
look at whether it's easy to get around that when i get back in town this
evening.

- stephan
Sent from a mobile device, possibly from bed. Please excuse brevity and
typos.
On Oct 4, 2014 7:44 AM, "Jacek Cała"  wrote:

> Hi all,
>
> I've noticed an unexecpected behaviour in fossil when doing a clone. The
> issue appears when you try clone with a wrong user name and as the result
> an empty repo is created. I'd rather expect an error on the console and
> nothing else.
>
> The thing is fully reproducible with the latest windows binaries (see
> below, when asked just type any random password). Even more unexpectedly
> you can try doing this on http://myfakeu...@www.fossil-scm.org/
>
> I'm not sure why failing to login to fossil-scm still clones the repo or
> why failing to my repo creates an empty repo. Is this by design?
>
>   Best,
>   Jacek
>
> > fossil clone http://myfakeu...@egenome-fossil.cloudapp.net/e-Genome
> repo.fossil
> password for MyFakeUser: **
> remember password (Y/n)? n
> Round-trips: 2   Artifacts sent: 0  received: 0
> Error: login failed
> password for MyFakeUser: *
> remember password (Y/n)? n
> Round-trips: 3   Artifacts sent: 0  received: 0
> Error: login failed
> Round-trips: 3   Artifacts sent: 0  received: 0
> Clone finished with 907 bytes sent, 865 bytes received
> Rebuilding repository meta-data...
>   100.0% complete...
> project-id: 0f5ea9d3c8bb48d8de1f1075b62026a6c7538d1e
> admin-user: MyFakeUser (password is "6af0d9")
> > dir
> 04/10/2014  06:3958,368 repo.fossil
>
>
> ___
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>
>
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] Cloning repo

2014-10-03 Thread Jacek Cała
Hi all,

I've noticed an unexecpected behaviour in fossil when doing a clone. The
issue appears when you try clone with a wrong user name and as the result
an empty repo is created. I'd rather expect an error on the console and
nothing else.

The thing is fully reproducible with the latest windows binaries (see
below, when asked just type any random password). Even more unexpectedly
you can try doing this on http://myfakeu...@www.fossil-scm.org/

I'm not sure why failing to login to fossil-scm still clones the repo or
why failing to my repo creates an empty repo. Is this by design?

  Best,
  Jacek

> fossil clone http://myfakeu...@egenome-fossil.cloudapp.net/e-Genome
repo.fossil
password for MyFakeUser: **
remember password (Y/n)? n
Round-trips: 2   Artifacts sent: 0  received: 0
Error: login failed
password for MyFakeUser: *
remember password (Y/n)? n
Round-trips: 3   Artifacts sent: 0  received: 0
Error: login failed
Round-trips: 3   Artifacts sent: 0  received: 0
Clone finished with 907 bytes sent, 865 bytes received
Rebuilding repository meta-data...
  100.0% complete...
project-id: 0f5ea9d3c8bb48d8de1f1075b62026a6c7538d1e
admin-user: MyFakeUser (password is "6af0d9")
> dir
04/10/2014  06:3958,368 repo.fossil
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users