/srv/irclogs.ubuntu.com/2012/03/06/#bzr.txt

jelmerhi wgz, poolie00:03
=== mwhudson_ is now known as mwhudson
vilahi all !07:59
mgzmorning!08:01
poolievila, mgz, jelmer, hi08:02
wgzshall we get the hangout started?08:06
poolieyep08:06
wgzI want to hear how the skiing was vila :)08:07
vilahehe, bad during a deep learning phase and just great when I decided to enjoy it ;)08:08
jelmerrats, forgot about the call08:30
wgzhttp://lwn.net/Articles/485162/09:12
vilajelmer: thanks for your attention to details ;)11:30
=== Amoz is now known as Afougner
=== Afougner is now known as Amoz
m1schi. i've setup loggerhead, i am able to load the webinterface, but it fails to load a random selection of resources like .js files etc. (loggerhead 1.18.1)13:46
jelmerm1sc: how are you running loggerhead?13:47
m1scjelmer: /srv/bazaar/loggerhead/serve-branches --host 127.0.0.1 --port 8082 --allow-writes --prefix /bzr/devel/ repos/devel/13:48
m1sc(behind apache proxy - same behaviour without proxy..)13:48
jelmerm1sc: does it work without the prefix perhaps?13:49
m1scjelmer: let me check..13:49
m1scjelmer: seems like the proxy is the problem - apparently some GET requests don't get through.. (at least serve-branches is logging only those requests for files not "missing")14:25
=== deryck_ is now known as deryck
abentleyvila: it seems b.get_config().set_user_option('pqm_email', 'PQM <pqm@example.com>') doesn't work in bzr.dev r6480.  Do I need to explicitly save or something?15:36
vilaabentley: hmm, if pqm_email has been migrated to use config stacks, then only config stacks should be used to access it15:38
vilaabentley: more precisely: if the writes are done by config stacks, they may be delayed and the old config reads will miss the updates15:38
abentleyvila: this is test code that worked with 2.515:38
vilaabentley: config stacks are available in 2.515:39
mgzabentley: try unlocking the branch15:39
abentleyvila: I know.15:39
abentleymgz: the branch isn't locked AFAIK15:40
mgzdepending on how your test is written, you may want that to flush the changes15:40
mgzthere's an mp from vila where he changed a bunch of test cases that may be a useful reference15:40
* vila nods15:40
mgzmost of them could just be simplified, a few needing a bit of an extra dance15:40
vilaabentley: or re-open the branch ?15:41
abentleyvila: I'm re-opening the branch, and it's not seeing the value I wrote.15:41
vilaabentley: meh, I need to see more code then15:41
abentleyvila: It's bzr-pqm, test case test_lpland.TestSubmitter.test_set_message15:42
vilabut set_user_option() has not been changed so it should save15:42
abentleyvila: Sorry, that should be test_lpland.TestSubmitter.test_make_submission_email15:44
vilano make_submission_email in pqm revno 8515:45
vilaghaaa15:45
vila8415:45
abentleyvila: It's in 89.15:45
vilaabentley: it works if you s/get_config().set_user_option/get_config_stack().set/15:50
abentleyvila: that's nice, but bzr-pqm supports bzr 2.4 and earlier, so it won't work for this.15:51
jelmerabentley: bzr-pqm already has some code that looks as bzrlib.version_info - any reason that wouldn't work here?15:52
abentleyjelmer: It would certainly be possible to add more compatibility code.  But this looks like a bug, esp. since it worked in 2.515:53
vilaabentley: well, avoiding IOs means caching values, that's what you run into, you don't lock the branch for writing but still modifies its config, I don't remember production code allowing that and I had to fix several tests that were relying on the branch being writable15:55
abentleyvila: I believe set_option locks and unlocks.15:56
vilathe config file only, not the branch15:56
vilaand set_user_option also read and write the whole file15:57
vilawhich is what we want to avoid15:57
abentleyvila: 1742: self.branch.lock_write()15:57
vilaECONTEXT15:58
abentleyvila: bzrlib/config.py:1742: self.branch.lock_write()15:58
vilaha, right, yes, that's what I was saying, this will read and write the whole file ignoring the the fact that the option has been migrated and should use the new code16:00
vilayou can't mix the two code paths for the *same* option16:00
abentleyvila: You said "you don't lock the branch for writing but still modifies its config, I don't remember production code allowing that".  This is production code that allows that.16:00
vilaright, that part was wrong :)16:01
vilaand the lines before 1742 also mentions that the approach used here needs to be fixed16:02
abentleyvila: Yes, but it's written by you, so it's no surprise it agrees with you :-)16:03
vilahehe16:03
abentleyvila: the point is, I'm writing a value, then reading it, and it's not working.  If we really should not be using set_user_option, then it should be deleted from the API.16:04
vilain ideal world, yes, but it cannot be removed until all plugins migrate to the config stacks16:05
abentleyvila: If it's not removed, then it needs to co-exist with config stacks properly.16:05
vilawell, avoiding IOs means caching values16:06
vilayou use one API to set and a different one to read16:06
abentleyvila: That may be, but the branch is unlocked, and I haven't accessed any config stacks when I write.16:06
wgzI was under the impression the old apis would function as before,16:06
wgzand the benefits to fewer config disk reads would be limited to code using the new interface16:07
abentleyvila: If you can't use one API to set and a different one to read, then the API should be removed.  Otherwise, people are going to do it by accident or laziness.16:07
wgzif a (non-bogusly written) test is failing with the old interface, how sure are we plugins won't also break?16:07
vilaI think what happens here is that 'pqm_email' is read with the new API16:07
vilawgz: we can't be sure but that's the first report I hear about where it fails16:09
vilaOverall, we *read* options in 99% of the cases and migrating an option to the config stacks should be done for both the code and the tests16:10
vilathe alternative is a big switch day which has been vetoed long ago16:11
vilait's also why I landed this change in 2.6 so we have a full cycle to debug the issues16:12
wgzthat seems fair16:16
wgzwe do want a way to write config tests that will work across multiple bzr versions though realy16:17
wgzjelmer: (unrelated to anything) wasn't there some bug related to bzrdir got imported? I'm now failing to find it or remember the details.16:18
abentleywgz: pqm-submit has its own implementation of config stacks to provide compatibility with 2.4 and lower.  This doesn't seem ideal.16:18
wgzabentley: indeed not.16:19
vilawgz: avoiding the caching issues can be avoided by writing tests that don't try to cache branch/tree objects or expect them to not cache any config values16:20
jelmerwgz: yes, bzrlib.workingtree didn't import bzrdir for a while16:21
wgzmostly plugins that support multiple versions haven't switched yet (and some don't have tests...) but a way to get the benefits without breaking too badly would be really good16:21
jelmerwgz: that meant that if you didn't run bzrlib.plugin.load_plugins() you might end up trying to open a control directory while the format handler for .bzr/ wasn't yet registered16:21
jelmerwgz: for that reason, we now explicitly import bzrlib.bzrdir from bzrlib.branch, bzrlib.repository and bzrlib.workingtree16:22
vilawgz: my understanding is that you run into this issue only if you mix the two code paths for the *same* option and modifies it (naively) with the old code path16:22
wgzjelmer: ah yes, that was it, thanks, gmail search let me down.16:23
wgzbug 90521816:23
ubot5Launchpad bug 905218 in Bazaar "bzrlib.initialize() misses out the default prober" [Critical,Fix released] https://launchpad.net/bugs/90521816:23
jelmerwgz: we could move the probers out of bzrlib.bzrdir into bzrlib.bzrformats or something (and leave the actual implementation in bzrlib.bzrdir); that would allow us to access foreign formats without loading any of the bzr-specific code16:23
jelmers/any/barely any/16:23
wgzthat would be neat.16:23
wgzvila: that seems quite likely during transition16:25
vilawgz: which part ?16:26
wgzmixing up old and new config calls on the same option16:26
vila*and* modifies the option ?16:27
vilaearly enough to fall into the trap ?16:27
vilanot in a test ?16:27
wgzhaving some clear guidelines on The Right Way seems useful16:27
vilayup16:27
abentleyvila: _get_config_store seems to remember cache the BranchStore, but the BranchStore doesn't seem to care about locks.  Could this be the cause of the problem?16:28
abentleyvila: I think it should not set self.conf_store for unlocked branches, or perhaps it should be needs_read_lock.16:29
vilaabentley: more likely the issue is that the branch does not clear the cached config when unlocking when that was deliberate to avoid a read at the next option access16:30
vilaremove the second when16:30
abentleyvila: I thought I saw code to clear it in Branch.unlock.16:31
vilahmm, I see self.conf_store.save_changes() in unlock (branch.py line 2564)16:33
abentleyvila: Maybe it should be in Branch._clear_cached_state ?16:33
abentleyvila: Yeah, but I don't actually see it clearing it.16:33
vilabecause clearing it lose half of the optimization, save_changes() already read/write the file, throwing it away it a waste16:34
abentleyvila: if you don't clear it when you really unlock the branch, you run the risk of using stale data, don't you?16:35
abentleyvila: If the branch is being locked for the right duration, it shouldn't throw away the optimization, I would think.16:36
vilahmm, sounds convincing... but I expect more test bugs in that case16:38
abentleyvila: Also, it looks like you're calling save_changes on every call to Branch.unlock, even if the branch has been locked multiple times.16:40
abentleyvila: If so, you are doing more I/O than necessary.16:41
abentleyvila: Though this may be theoretical since setting config is rare.16:42
vilaif there is no changes there is no IO but the other point is worth investigating16:42
vilaI thought unlock was protected by some other mean but imbw16:43
abentleyvila: right.  To do extra IO, you'd need to Branch.lock_write(); Branch.get_config().set(); Branch.lock_write(); Branch.get_config.set(); Branch.unlock(); Branch.unlock()16:43
abentleysorry, s/get_config/get_config_stack/16:44
vilayeah, if unlock is always called, I thought there was some mechanism to call it only for the outer call but I don't see the relevant code (or I'm confused by another implementation)16:44
abentleyvila: Or another case would be Branch.lock_write(); Branch.get_config_stack().set(); Branch.lock_read(); Branch.unlock(); Branch.get_config_stack.set(); Branch.unlock();16:45
abentleyvila: I believe Branch.unlock will actually get called, but "if not self.control_files.is_locked" prevents action if we haven't actually unlocked.16:46
vilain any case, save_changes() should be called *before* the real unlocking happen16:47
abentleyvila: most definitely.16:48
vilaoh crap the texinfo/sphinx issue is still pending for bzr.dev16:51
=== zyga-xchat is now known as zyga
mgzvila: yeah. Gordan worked around it by renaming the bzr bundled texinfo.16:54
vilaneat16:55
abentleyvila: Here is a  test that demonstrates the caching problems: http://pastebin.ubuntu.com/871738/17:07
vilaabentley: thanks17:09
vilaI always known that there are issues with caching the config values, the real question has always been: which use case will it break ?17:10
vilas/known/knew/17:10
vilaIn practice, once you open a branch in read-mode, another process can open it in write mode and change the config values, is there a case where we should care ?17:11
abentleyvila: Arguably when we read-lock the branch, we should cache all cacheable values.17:13
vilaabentley: right, the old code didn't do that, the new one does17:13
vilabut that doesn't give us a use case where it breaks :)17:13
abentleyvila: No, it doesn't do it when we read-lock the branch.17:13
abentleyvila: It does it afterward.17:14
vilaha, right17:14
vilayeah17:14
vilabut it's very early (stacked_on_location)17:14
vilaor some other option17:14
abentleyvila: But that's *before* we read-lock the branch.17:14
vilamwhahahah17:14
vilaeven worse :)17:15
abentleyvila: I've been wanting us to open all branches in locked mode for years.17:15
abentleyvila: e.g. Brach.open_read_locked(), Branch.open_write_locked().17:15
vilathe fact that we didn't encounter bugs around this (yet) hints that it's not that vital either17:16
abentleyvila: I recall hitting plenty of bugs that this would have solved.17:16
vilabut I agree it would be far cleaner17:16
vilaha17:17
viladid you file some ?17:17
abentleyvila: But like I say, it's been years.17:17
abentleyvila: I think it would also fix the bug I'm showing here.17:17
vilaright17:18
abentleyvila: Well, it would if we cleared the store on unlock.17:18
vilathe fact that we can use unlocked branches means many tests just did that17:19
vilayeah17:19
vilaIf no test fails doing that it's a no-brainer17:19
vilaabentley: can you file a bug and I'll look into it tomorrow ? (too many juggling eggs right now)17:20
abentleyvila: For sure.  I was going to land a couple of expectedFailure tests.17:20
vilaabentley: there are several bugs (not clearing, saving only for the outer call) but a single one should do for the discussion about the balance between some caching and no caching at all17:23
vilaabentley: deprecating set_user_option for already migrated options may be an option too17:24
vilaalready migrated == registered17:24
abentleyvila: deprecation implies that it works, but you shouldn't use it.  This is a case where it doesn't work.  Because you can call set_user_option, and then invoke code that does get.17:25
vilaabentley: strictly speaking, yes, I was thinking about a warning to guide people during the migration17:26
vilaabentley: the check is cheap and the output would help17:27
abentleyvila: IMO, we expect APIs to break during betas, so we should just remove set_user_option.  Keeping it around is unnecessary pain.17:27
vilaabentley: that would mean breaking all plugins that still use the old API, sounds a bit painful too17:28
vilaa bit *too* painful even17:28
abentleyvila: Well, maybe in this case, but in general, removing APIs is going to break all plugins that use it.17:30
vilaespecially given that *setting* options programatically (sp?) is the exception rather than the norm and the bug is triggered only when you mix both APIs17:30
vilaboth APIs for the *same* option17:30
abentleyvila: I dunno.  There are certainly going to be plugins that set options and then expect bzrlib to respect them.17:31
vilaso far you can still use both APIs as long as you don't mix them which is a softer path for migration (but jelmer already said he was for deprecating the old config during the 2.6 cycle while I was targetting 2.7)17:32
abentleyvila: I don't think it's practical to avoid mixing them, because you can use config stacks indirectly via bzrlib.17:33
vilaabentley: I'm not that sure about that, options are rarely set by plugins themselves, *users* set options17:33
=== deryck is now known as deryck[lunch]
abentleyvila: In which case, it shouldn't be to painful to remove set_user_option? :-)17:34
vilahehe17:35
abentleyvila: AFAICT, self.branch.get_config_stack().set('foo', 'bar') does IO.17:39
vilaabentley: yes :-/17:39
vilaabentley: but17:39
vilab.lock() ; b.get_config_stack().set('foo', 'bar') doesn;t until b.unlock()17:40
vilathis was changed during the review as it made easier to use17:40
vilas/made/made it/17:41
abentleyvila: I'm doing it in a locked branch.17:41
vila<cough> It's what the bug you're about to file is about now ? :)17:42
vilas/now/no/17:42
vilas/if self.conf_store is not None/if self._control_files._lock_count == 1 and self.conf_store is not None/17:42
abentleyvila: Well, this is the fact that branch.unlock unconditionally does IO17:43
vilas/unconditionally/if there are changes to save/17:43
abentleyvila: Right.  BranchStack.set is needs_write_lock, so it implicitly does Branch.unlock.17:46
vilaabentley: yup and it should *not* trigger save_changes() if the branch is already locked, that's a bug17:47
vilaabentley: then, save_changes() itself will trigger an IO *only* if there have been changes since the last read17:48
abentleyvila: Right.17:48
vilaabentley: it's unfortunate I missed the save-on-last-unlock part given how many tests failed during this change :-/17:49
vilaabentley: I will add the missing tests while fixing this17:49
vilaabentley: but the plan is definitely to *not* write until the last unlock17:50
abentleyvila: this means Branch.get_config_stack.set() will interoperate with Branch.get_config.get_user_option correctly.17:50
vilaindeed17:50
abentleyvila: Until the bug is fixed.17:50
vilaindeed again, which is why I expect for test bugs17:51
vilathe weird thing is that I'm pretty sure there are some hpss test that should have failed if each set() was trigerring an IO, but maybe the remote branch object does calls the branch.unlock() only for the outer unlock...17:53
vilaabentley: EOD here, thanks for the feedback17:54
abentleyvila: np17:54
=== zyga is now known as zyga-afk
=== yofel_ is now known as yofel
=== deryck[lunch] is now known as deryck
abentleyvila: Bug #948344 and #94833919:50
ubot5Launchpad bug 948344 in Bazaar "BranchConfig and BranchStack do not interoperate correctly" [Medium,Triaged] https://launchpad.net/bugs/94834419:51
ubot5Launchpad bug 948339 in Bazaar "BranchStack caching misbehaves" [Medium,Triaged] https://launchpad.net/bugs/94833919:51
sarrveshI need help with pulling a branch using bazaar.I tried executing the command bzr branch lp:ubuntu/unity-greeter20:57
sarrveshin terminal20:57
sarrveshbut I got the following error message20:57
sarrveshAgent admitted failure to sign using the key.20:57
sarrveshPermission denied (publickey).20:57
sarrveshConnectionReset reading response for 'BzrDir.open_2.1', retrying20:57
sarrveshAgent admitted failure to sign using the key.20:57
sarrveshPermission denied (publickey).20:57
sarrveshbzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.20:57
sarrveshHow do I overcome this?20:57
sarrveshPlease help20:57
jelmerhi sarrvesh20:59
sarrveshhi20:59
jelmersarrvesh: it sounds like you haven't set up a SSH key but have specified your launchpad login with "bzr lp-login"20:59
sarrveshno but I pasted my ssh public key into launchpad21:00
sarrveshany idea how to overcome this?21:08
jelmersarrvesh: do you have your ssh key added locally?21:12
jelmerDid you tell bzr about your launchpad login name using "bzr lp-login" ?21:12
sarrveshyea i did21:13
sarrveshfirst i did bzr whoami "name <email_id>"21:13
fullermdThe error message sounds like something with the agent.21:13
sarrveshthen i did bzr launchpad-login <username>21:14
thomiHi everyone - I'm having an issue related to bzrlib - in sloecode we do this:  "to_transport = repo.user_transport.clone('trunk')" in order to create a repo for a new project, but I get this exception: AttributeError: 'CHKInventoryRepository' object has no attribute 'user_transport'22:05
thomihowever I think this is because the repositories on disk may have become corrupted. Any hints as to what that exception means, and how I can fix it?22:06
lifelessbzrlib version skew I suspect22:07
thomiso... the repositories were created with version X, but the system has version Y installed?22:08
lifelessthomi: so your *code* was created for version X and your *code* doesn't work with version Y22:13
thomilifeless: I see, that makes more sense. :)22:13
thomiThanks22:14
thomiok, so my code uses bzrlib v2.5, but doesn't work with ver 2.1. At least now I know what the issue is22:17
richoI'm looking for a unicode version of the bzr logo- like ± for git or ☿ for hg. Is there such a thing?22:50
lifelessprobably not22:50
jelmerI'm sure there must be a unicode symbol for merging traffic ?22:53
richothat's what I thought22:54
richobut I spent ages looking through glyph tables and didn't find anything, thought it might be easier to just ask22:54
jelmerU+26D7 is in the right sort of area23:01
spiv⤖ perhaps?23:07
spivOr ⤴23:07
jelmer23:10
spivThat's a very tidy rendering of 2, 6, D, and 7 inside a rectangle :P23:11
jelmernot here, here it is rendered as ⛗ :P23:12
jelmerI guess you're using a different font than I am23:12
spivInconsolata, but it typically falls back to another font if necessary for a particular glyph23:13
spivBut I am on a lucid system.23:13
jelmerah, ok23:13
jelmeryou're running gooboontoo?23:13
spivI'm not sure it has quite that many "o"s in it :)23:14
james_wU+26D8: BLACK LEFT LANE MERGE sounds promising23:14
spivBikeshedding: Unicode Edition!23:15
=== mlh_ is now known as mlh
jelmerspiv: I'm sure you mean 🚲shedding23:16
spivREPLACEMENT CHARACTERshedding?  Yes, yes I do!23:16
* mwhudson is failing at fonts for this conversation too23:16
jelmerme too actually23:17
* mwhudson is amused by the way the character map applies bold and italic to unrendered characters23:18
* jelmer quickly closes Character Map before he finds more unicode characters representing things like KISSING CAT FACE WITH CLOSED EYES23:18
mwhudsoni now have a bold, italic 2, 6, D, and 8 in a box!23:18
jelmermwhudson: I wonder what a bold bicycle looks like :P23:19
SamBjelmer: I think that one is made using several JIS characters23:20
SamBthe cat one23:20
jelmerah23:22
richodamn, this charset doesn't have glyphs for any of those :23:28
richo:(23:28

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!