You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(38) |
Nov
(98) |
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(114) |
Feb
(123) |
Mar
(96) |
Apr
(66) |
May
(84) |
Jun
(72) |
Jul
(128) |
Aug
(126) |
Sep
(82) |
Oct
(80) |
Nov
(148) |
Dec
(55) |
2002 |
Jan
(137) |
Feb
(85) |
Mar
(118) |
Apr
(67) |
May
(71) |
Jun
(28) |
Jul
(69) |
Aug
(48) |
Sep
(83) |
Oct
(79) |
Nov
(54) |
Dec
(32) |
2003 |
Jan
(44) |
Feb
(47) |
Mar
(59) |
Apr
(57) |
May
(43) |
Jun
(45) |
Jul
(44) |
Aug
(39) |
Sep
(27) |
Oct
(62) |
Nov
(17) |
Dec
(23) |
2004 |
Jan
(41) |
Feb
(51) |
Mar
(38) |
Apr
(30) |
May
(25) |
Jun
(12) |
Jul
(11) |
Aug
(27) |
Sep
(16) |
Oct
(56) |
Nov
(23) |
Dec
(29) |
2005 |
Jan
(75) |
Feb
(82) |
Mar
(50) |
Apr
(77) |
May
(19) |
Jun
(104) |
Jul
(47) |
Aug
(42) |
Sep
(28) |
Oct
(143) |
Nov
(62) |
Dec
(13) |
2006 |
Jan
(20) |
Feb
(10) |
Mar
(59) |
Apr
(45) |
May
(25) |
Jun
(129) |
Jul
(162) |
Aug
(91) |
Sep
(15) |
Oct
(39) |
Nov
(186) |
Dec
(191) |
2007 |
Jan
(134) |
Feb
(140) |
Mar
(106) |
Apr
(77) |
May
(92) |
Jun
(63) |
Jul
(233) |
Aug
(102) |
Sep
(119) |
Oct
(63) |
Nov
(68) |
Dec
(32) |
2008 |
Jan
(69) |
Feb
(91) |
Mar
(129) |
Apr
(44) |
May
(18) |
Jun
(53) |
Jul
(50) |
Aug
(25) |
Sep
(11) |
Oct
(28) |
Nov
(67) |
Dec
(36) |
2009 |
Jan
(20) |
Feb
(24) |
Mar
(66) |
Apr
(53) |
May
(48) |
Jun
(48) |
Jul
(59) |
Aug
(82) |
Sep
(49) |
Oct
(30) |
Nov
(16) |
Dec
(16) |
2010 |
Jan
(52) |
Feb
(25) |
Mar
(36) |
Apr
(34) |
May
(14) |
Jun
(15) |
Jul
(14) |
Aug
(16) |
Sep
(23) |
Oct
(6) |
Nov
(4) |
Dec
(5) |
2011 |
Jan
(4) |
Feb
(22) |
Mar
(45) |
Apr
(9) |
May
(8) |
Jun
(13) |
Jul
(12) |
Aug
(4) |
Sep
(6) |
Oct
(10) |
Nov
(21) |
Dec
(5) |
2012 |
Jan
(6) |
Feb
(9) |
Mar
(25) |
Apr
(6) |
May
(4) |
Jun
(23) |
Jul
(6) |
Aug
(18) |
Sep
(21) |
Oct
(34) |
Nov
(19) |
Dec
(25) |
2013 |
Jan
(8) |
Feb
(34) |
Mar
(35) |
Apr
(4) |
May
(11) |
Jun
(4) |
Jul
(7) |
Aug
(5) |
Sep
(20) |
Oct
(12) |
Nov
(11) |
Dec
(7) |
2014 |
Jan
(10) |
Feb
(18) |
Mar
(50) |
Apr
(26) |
May
(53) |
Jun
(21) |
Jul
(12) |
Aug
(39) |
Sep
(43) |
Oct
(26) |
Nov
(8) |
Dec
(6) |
2015 |
Jan
(18) |
Feb
(32) |
Mar
(31) |
Apr
(42) |
May
(38) |
Jun
(13) |
Jul
(6) |
Aug
(11) |
Sep
(29) |
Oct
(25) |
Nov
(10) |
Dec
(11) |
2016 |
Jan
(24) |
Feb
(12) |
Mar
(13) |
Apr
(15) |
May
(22) |
Jun
(8) |
Jul
(12) |
Aug
(25) |
Sep
(8) |
Oct
(6) |
Nov
(13) |
Dec
(7) |
2017 |
Jan
(6) |
Feb
(29) |
Mar
(32) |
Apr
(8) |
May
(82) |
Jun
(42) |
Jul
(20) |
Aug
(17) |
Sep
(27) |
Oct
(14) |
Nov
(22) |
Dec
(6) |
2018 |
Jan
(12) |
Feb
(9) |
Mar
(22) |
Apr
(19) |
May
(14) |
Jun
(9) |
Jul
(9) |
Aug
(22) |
Sep
(22) |
Oct
(12) |
Nov
(13) |
Dec
(8) |
2019 |
Jan
(22) |
Feb
(3) |
Mar
(30) |
Apr
(20) |
May
(20) |
Jun
(6) |
Jul
(15) |
Aug
(25) |
Sep
(11) |
Oct
(24) |
Nov
(11) |
Dec
(6) |
2020 |
Jan
(9) |
Feb
(12) |
Mar
(29) |
Apr
(10) |
May
(22) |
Jun
(11) |
Jul
(15) |
Aug
(5) |
Sep
(6) |
Oct
(7) |
Nov
(7) |
Dec
(13) |
2021 |
Jan
(21) |
Feb
(5) |
Mar
(5) |
Apr
(6) |
May
(10) |
Jun
(7) |
Jul
(6) |
Aug
(8) |
Sep
(5) |
Oct
(9) |
Nov
(5) |
Dec
(6) |
2022 |
Jan
(5) |
Feb
(4) |
Mar
(8) |
Apr
(6) |
May
(5) |
Jun
(5) |
Jul
(10) |
Aug
(6) |
Sep
(7) |
Oct
(4) |
Nov
(4) |
Dec
(6) |
2023 |
Jan
(5) |
Feb
(5) |
Mar
(6) |
Apr
(4) |
May
(5) |
Jun
(6) |
Jul
(5) |
Aug
(5) |
Sep
(5) |
Oct
(5) |
Nov
(7) |
Dec
(8) |
2024 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2025 |
Jan
|
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Jeff A. <ja...@fa...> - 2017-09-26 08:11:41
|
I notice the CPython devguide -- therefore the future Jython devguide(!) -- has similar advice (https://devguide.python.org/committing#commit-messages) to Frank's recommendation below: pithy one-liner, blank line, complete brief information. It refrains from specifying actual line lengths, but 72 has been working for me. (Never sure whether to line-break paragraph #2+ manually.) And GitHub is unforgiving after 72: https://github.com/jython/jython3/commit/5b4dc2d54d01a6fda8c55d07b2608167e7a40769, so I guess we'll have to fit in. Jeff On 12/09/2014 07:21, Jeff Allen wrote: > I'm happy to follow Frank. Scrolling back down Hg Workbench I see that > (lately) he, Indra and Santoso to varying degrees follow the > recommended convention. (I'm not sure I can stick to 50 for the > summary!) Hg Workbench gives me a settable red line, by default at > column 80 (but 72 if we follow the blog). I seem to have wrap and EOL > options, but they don't stick :(. > > Jeff > Jeff Allen > On 11/09/2014 23:47, Jim Baker wrote: >> >> +1, as a frequent violator myself. I plan to reform my ways ;), since >> this makes a lot of sense for seeing the summaries in the abstract, >> vs say just reviewing hg log. >> >> >> -- >> - Jim >> Jim Baker >> >> >> On September 11, 2014 at 3:44:06 PM, fwi...@gm... >> (fwi...@gm... <mailto:fwi...@gm...>) wrote: >> >>> On Thu, Sep 11, 2014 at 1:23 PM, Jeff Allen <ja...@fa...> wrote: >>> > Mercurial will use your commit message up to the first line break >>> as the >>> > abstract it displays, for example here: http://hg.python.org/jython/ >>> > Worth thinking about how that will read. I don't think we have an >>> actual >>> > rule about length. >>> Although I don't always practice it, I like the guideline that I've >>> seen in git circles detailed here: >>> http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html >>> >>> The important part being a 50 char or less first line separated by a >>> blank line, followed by the detailed message if necessary. >>> >>> -Frank >>> > |
From: Jeff A. <ja...@fa...> - 2017-09-26 07:11:10
|
Thanks Ernest! First observed for me last night: Mon, 25 Sep 2017 about 21:00 +0100, but I haven't pushed for about 4 weeks (been working in a forked repo). I started this thread almost immediately after the merge and push (https://hg.python.org/jython/rev/50393fac6f20). My push 4 weeks ago (/Sun Aug 27 07:45:40 EDT 2017/) is the last thing on the archive https://mail.python.org/pipermail/jython-checkins/2017-August/date.html and I remember no such an error. Since Jim says "I have also seen this error. ..." I assume that would have been when pushing soon after Sat, 09 Sep 2017 14:02:01 -0600 (https://hg.python.org/jython/rev/8d52ad2559f5). However, he could be more precise. So on or after 27 Aug and (maybe) before 10 Sep? Jeff On 26/09/2017 00:49, Ernest W. Durbin III wrote: > Hey! > > Ernest here! I’m one of the volunteers on the PSF infra staff. > > Yeah it is fair to say that the mercurial installation has not gotten > much love since the core python workflows moved to GitHub. > But we also haven’t heard any complaints until now. > > I’m AFK right now but will be able to spend some time trying to help > in the morning. > > Was this a recent failure for y’all or has it been ongoing? Knowing > when it went goofy will be a big help! > > -Ernest > > On September 25, 2017 at 6:13:46 PM, Jeff Allen (ja...@fa... > <mailto:ja...@fa...>) wrote: > >> Or administered on the assumption everyone has moved Git. >> https://hg.python.org/?sort=lastchange >> >> I think this (fairly obviously) is the hook that sends e-mail, but >> why the call has changed I can't guess. >> >> I'm happy to move to GitHub. Start with the CPython dev guide as it >> contains a well thought-out way of working? (I keep meaning to.) >> >> Jeff >> >> >> On 25/09/2017 21:40, Jim Baker wrote: >>> I have also seen this error. I assume that a post-commit hook is >>> being run on the hg server, and it is failing. Not good. >>> >>> This message may be implicitly telling us we need to get off >>> hg.python.org <http://hg.python.org> sooner than later, since it's >>> no longer being as actively administered. (Perhaps not at all in fact.) >>> >>> On Mon, Sep 25, 2017 at 2:35 PM, Stefan Richthofer >>> <Ste...@gm... <mailto:Ste...@gm...>> wrote: >>> >>> Also observed these errors and additionally I did not receive an >>> email notification from jython-checkins. >>> Not that I cared too much for the email notification (still nice >>> to have), but I suspect the issues could be >>> related. Or did you receive email notification for recent pushes? >>> *Gesendet:* Montag, 25. September 2017 um 22:20 Uhr >>> *Von:* "Jeff Allen" <ja...@fa... <mailto:ja...@fa...>> >>> *An:* "Jython Developers" <jyt...@li... >>> <mailto:jyt...@li...>>, >>> inf...@py... >>> <mailto:inf...@py...> >>> *Betreff:* [Jython-dev] Errors when pushing to >>> hg.python.org/jython <http://hg.python.org/jython> >>> >>> Just now got these error messages, actually 4 repeats, one for >>> each change set: >>> >>> PS jython-int> hg push >>> pushing to ssh://hg...@hg.../jython >>> <mailto:ssh://hg...@hg.../jython> >>> searching for changes >>> remote: adding changesets >>> remote: adding manifests >>> remote: adding file changes >>> remote: added 4 changesets with 28 changes to 25 files >>> remote: Traceback (most recent call last): >>> remote: File "/srv/hg/repos/hooks/mail.py", line 166, in incoming >>> remote: return _incoming(ui, repo, **kwargs) >>> remote: File "/srv/hg/repos/hooks/mail.py", line 102, in _incoming >>> remote: diffstat = patch.diffstat(iterlines(diffchunks), >>> width=60, git=True) >>> remote: TypeError: diffstat() got an unexpected keyword argument >>> 'git' >>> remote: error: incoming.notify hook raised an exception: >>> diffstat() got an unexpected keyword argument 'git' >>> remote: (run with --traceback for stack trace) >>> >>> ... and 3 more the same (from "remote: Traceback ..."). >>> >>> It seems to have worked (my change sets landed), but something's >>> not right at the PSF end. Any ideas? >>> >>> Jeff >>> >>> ------------------------------------------------------------------------------ >>> Check out the vibrant tech community on one of the world's most >>> engaging tech sites, Slashdot.org! >>> http://sdm.link/slashdot_______________________________________________ >>> <http://sdm.link/slashdot_______________________________________________> >>> Jython-dev mailing list Jyt...@li... >>> <mailto:Jyt...@li...> >>> https://lists.sourceforge.net/lists/listinfo/jython-dev >>> <https://lists.sourceforge.net/lists/listinfo/jython-dev> >>> >>> ------------------------------------------------------------------------------ >>> Check out the vibrant tech community on one of the world's most >>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >>> _______________________________________________ >>> Jython-dev mailing list >>> Jyt...@li... >>> <mailto:Jyt...@li...> >>> https://lists.sourceforge.net/lists/listinfo/jython-dev >>> <https://lists.sourceforge.net/lists/listinfo/jython-dev> >>> >>> >> >> _______________________________________________ >> Infrastructure-staff mailing list >> Inf...@py... <mailto:Inf...@py...> >> https://mail.python.org/mailman/listinfo/infrastructure-staff |
From: Darjus L. <da...@gm...> - 2017-09-25 22:51:19
|
http://docs.oracle.com/javase/9/docs/api/jdk/dynalink/DynamicLinker.html Looks useful :) Darjus |
From: Darjus L. <da...@gm...> - 2017-09-25 22:47:24
|
Nice! On Mon, Sep 25, 2017 at 4:13 AM Jeff Allen <ja...@fa...> wrote: > Thanks Jim. I'm working on presenting this as a reduced number of commits > to make the change easier to follow. > > I'll strip out the debug too. After so many weeks, I shall miss it, but > it's too in-your-face. If we need it again, it will be on Bitbucket for a > while. > +1 for an early 2.7.2: we should make a short list of blockers on its own > thread. > > > Jeff > > > On 24/09/2017 17:18, Jim Baker wrote: > > Likewise, glad to see it was just a problem in the test setup. Everything > looks good now: the test demonstrates that the Python type mapping does not > prevent class GC, assuming nothing else refers to the Java class. Indeed > the earlier faulty version of the test further demonstrates that point, > given the parent classloader referring to the class, and preventing GC. > > I have also had a chance to review the rest of the change set, and > everything else looks great. In particular, I like how you have removed the > need to support the hack for hardRef, along with the management of deferred > initialization of types. > > Let's merge this code in, given that it's a substantial improvement over > the old implementation, with all tests passing. We should consider > releasing a 2.7.2 soon, since this and related changes has fixed serious > problems in re and other mixed usage of Java and Python via callbacks ( > http://bugs.jython.org/issue2609). Getting this out would then allow us > to work on Java 9 support in 2.7.3, as well as fixing up sys slowness and > related jsr223 (hopefully!). > > - Jim > > > > On Sun, Sep 24, 2017 at 3:19 AM, Jeff Allen <ja...@fa...> wrote: > >> As I suspected, the critical distinction is between the *initiating* >> class loader and the *defining* class loader. >> >> The defining class loader here turns out to be an instance of >> sun.misc.Launcher$AppClassLoader, the grandparent of our URLClassLoader >> that gets consulted before it tries the JAR URL we gave. >> org.python.tests.Callbacker appears in jython-dev.jar, so it is found there >> first. This is the same loader that holds PyObject, etc., so essentially >> permanent and keeps our test class alive. >> >> When this is all fixed by making the parent explicitly None in >> make_jar_classloader, everything is GC'd as we'd hope. (Phew!) >> >> >> https://bitbucket.org/tournesol/jython-fgtype/commits/4fd2baafb7499929f876ac20a607511668b3e222 >> Jeff >> >> >> >> On 18/09/2017 00:45, Jim Baker wrote: >> >> Jeff, >> >> I looked at the new test, and it's interesting to see the ClassLoader >> gets collected, but not the corresponding PyJavaType. To me this implies >> the Class was necessarily collected; but it's not observable directly in >> Python code. While you are busy on other things, I will try playing with >> this changeset some more to see what is going on here. Maybe it ends just >> being a simple question of setting up a ref queue on Class GC and calling >> ClassValue#remove. >> >> It's rather awesome about the simplification of fromClass, and removing >> the separate implementation of fromClassSkippingInners. >> >> - Jim >> >> On Sun, Sep 17, 2017 at 2:41 AM, Jeff Allen <ja...@fa...> wrote: >> >>> Jim: >>> >>> I figured out needsInners (I think!) and how I could make fromClass and >>> fromClassSkippingInners into one method using the state of the registry to >>> steer the action to be almost the same -- and reach the same conclusion -- >>> with a net reduction in code. >>> >>> >>> https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc1f52c9b3733841b375831f8a3c0d27a93e >>> >>> I have added a test to prove the PyType (actually PyJavaType) is GC'd >>> when we cease to reference it, using make_jar_classloader, but it is >>> presently failing. Applied retrospectively to successive change sets it >>> begins to fail exactly where I introduce ClassValue. :( >>> Maybe ClassValue doesn't quite work as I thought. Or I'm still not using >>> it as John Rose intended. It seems wrong we should have to layer weak >>> references on top or have some kind of removal queue. >>> >>> I tried visualvm to see where it might be referenced, but I'm not sure >>> how to interpret what it's telling me. However, this week, and maybe >>> longer, other things have priority. Ideas welcome for when I'm back to this. >>> For exposed PyObjects, I'm pretty sure classToBuilder always was keeping >>> a strong reference that would keep them alive now. (But not for the type >>> under test.) I've removed this effect. But maybe we don't mind that? >>> >>> https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc1f52c9b3733841b375831f8a3c0d27a93e#Lsrc/org/python/core/PyType.javaT1208 >>> >>> Jeff >>> >>> >>> On 12/09/2017 01:37, Jim Baker wrote: >>> >>> [I'm been having some problem posting to the jython-dev mailing list, >>> let's see if this response gets through!] >>> >>> On Mon, Sep 11, 2017 at 1:47 PM, Jeff Allen <ja...@fa...> wrote: >>> >>>> Jim: >>>> >>>> Thanks for the pointers. I agree with you on #2 that what I've got >>>> *should* behave correctly with class loaders, but is there a test you can >>>> suggest (or one I've missed) that conclusively demonstrates it? >>>> >>> >>> So I would start with test_support.make_jar_classloader, just because >>> it's easier to test this behavior in Python. test_classpathimporter seems >>> to use this support functionality nicely. >>> >>> If we want to add testing of our expectations around ClassValue's >>> lifetime, we can also add some sort of weakref scheme, in conjunction with >>> a multi-round GC, to verify that the PyType gets collected as expected. Of >>> course we should expect ClassValue to behave as expected, but this would >>> ensure we are not holding anything, now or in the future implementation, in >>> the Jython runtime that would violate this contract. >>> >>> >>>> I'll press in on the question of inners. I tried just calling >>>> fromClass, but it fails when the inner extends the outer (test_import_jy:: >>>> test_selfreferential_classes fails). You have to initialise the outer, then >>>> visit the inners. In a way, it's the PyJavaType counterpart of the deferred >>>> initialisation of exposed types that we control by identifying bootstrap >>>> types. But here it has to be self-guiding. >>>> >>>> I have an idea that if I can make fromClass and fromClassSkippingInners >>>> the same thing, then that can become the implementation >>>> classToValue.computeValue, and I won't need the NotReady exception or >>>> findExistingType. >>>> >>> >>> So Java classes can form a general type graph (directed, with cycles). >>> It seems to me that the NotReady acts as some sort of coloring in the graph >>> exploration that fromClass is doing. But as I said, I find this code for >>> inner classes rather subtle! Good luck in your coding here, it would be >>> really nice to get some further simplification. >>> >>> >>>> >>>> Jeff >>>> >>>> On 10/09/2017 01:12, Jim Baker wrote: >>>> >>>>> Thanks for working on this change set, it's really good stuff. In >>>>> particular, that's a very nice handoff you do in the PyType.Registry class, >>>>> specifically moving computed types from classToNewType to classToType; and >>>>> managing the NotReady state. Perhaps it needs some sort of state diagram to >>>>> illustrate, but as someone who has been in that code, it makes perfect >>>>> sense. >>>>> >>>>> With respect to GC, the following should be the case: >>>>> >>>>> * As long as the ClassLoader for the mapped Java class instance C is >>>>> around, the corresponding PyType instance T will live. This >>>>> follows from the definition of ClassValue as you point out in the >>>>> code comments. (Good!) >>>>> * As long as Python code holds a hard ref to T, the corresponding C >>>>> will live. (Good!) (So we would see this in from `some_java_pkg >>>>> import baz`; and it follows from the underlying_class field >>>>> holding a hard ref from T to C.) >>>>> * As long as Python code holds a hard ref to an instance of C, the >>>>> corresponding T will also live. (Good!) >>>>> >>>>> Otherwise, this mapping will allow for GC of T, and subsequently of C, >>>>> per the definition of ClassValue. I was also looking at Groovy's usage of a >>>>> similar mapping, and corresponding bug, >>>>> https://bugs.openjdk.java.net/browse/JDK-8136353, and it looks like >>>>> the problem reported there doesn't hold. This is because there are no >>>>> strong refs outside of PyType itself. >>>>> >>>>> So everything looks good for getting this change in. >>>>> >>>>> On Sat, Sep 9, 2017 at 2:12 PM, Jeff Allen <ja...@fa... >>>>> <mailto:ja...@fa...>> wrote: >>>>> >>>>> Jim, all: >>>>> >>>>> By a series of small steps I've come quite a long way in this >>>>> aspect of PyType. It might be worth a look. >>>>> >>>>> https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd >>>>> < >>>>> https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd >>>>> > >>>>> >>>>> In this last commit I've entirely dispensed with any long-term >>>>> reference to the created PyType in the type registry: only the >>>>> ClassValue holds one. The explicit management of reachability goes >>>>> away and we have just the behaviour given us by ClassValue. The >>>>> only down-side I see is that a PyType created for a Java class you >>>>> handle briefly from Python will not be collectable until the class >>>>> is. >>>>> >>>>> The old test for weakness, which I've been running in parallel >>>>> with the new, requires PyType.getClassToType(), and can no longer >>>>> be supported. (You can't enumerate the ClassValue.) I believe the >>>>> replacement tests the same thing -- they used to pass and fail >>>>> together. >>>>> >>>>> >>>>> Right, it makes sense to remove this test. This is because we don't >>>>> want to support the necessary mapping, even though it could be readily >>>>> supported with an appropriate concurrent weak mapping - the only semantics >>>>> it would be supporting is for this very test. >>>>> >>>>> >>>>> I've moved some actions around, and removed some of the checks. We >>>>> seemingly expected the desired PyType to be created at any moment >>>>> by a side effect. Reason and regression testing tell me that >>>>> doesn't happen in the new arrangement. I think there is slightly >>>>> less code to execute, but masses more comment and debug -- it's my >>>>> way of figuring it out. It's all very educational. >>>>> >>>>> I still don't understand: >>>>> >>>>> 1. Whether we find the downside (PyType not GC'd until the class >>>>> is) >>>>> important. >>>>> >>>>> >>>>> So we do know that Jython will continue to work if we remove a mapping >>>>> entry, since it happens all the time currently in some code like json, re, >>>>> and socket, where classes are not directly imported :) We could always do >>>>> some sort of LRU and then call ClassValue#remove, but I don't think it >>>>> makes sense. There are many other other optimizations in the runtime first. >>>>> >>>>> 2. Whether I have broken something that the regression tests don't >>>>> cover (like use with isolating class loaders). >>>>> >>>>> >>>>> These are different Java classes if in different class loaders. For >>>>> Python usage of these Java classes, it's all the same, thanks to duck >>>>> typing, but we need to maintain a different mapping entry. Again #1 >>>>> demonstrates we have been handling this correctly in the current codebase. >>>>> >>>>> 3. What needsInners is really up to. I see *what* it does, but not >>>>> *why* well enough to consider alternatives. It would simplify >>>>> computeValue if there were no fromClassSkippingInners: could >>>>> needsInners be a registry global? And why do we skip processing >>>>> them, when we do? >>>>> >>>>> >>>>> That codepath is exceedingly subtle, at least to me. But it would be >>>>> an interesting experiment to see if it could be made global, vs this >>>>> potentially expanding context that is passed through. >>>>> >>>>> - Jim >>>>> >>>> >>>> >>> >>> >> >> > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-dev > |
From: Jeff A. <ja...@fa...> - 2017-09-25 22:13:59
|
Or administered on the assumption everyone has moved Git. https://hg.python.org/?sort=lastchange I think this (fairly obviously) is the hook that sends e-mail, but why the call has changed I can't guess. I'm happy to move to GitHub. Start with the CPython dev guide as it contains a well thought-out way of working? (I keep meaning to.) Jeff On 25/09/2017 21:40, Jim Baker wrote: > I have also seen this error. I assume that a post-commit hook is being > run on the hg server, and it is failing. Not good. > > This message may be implicitly telling us we need to get off > hg.python.org <http://hg.python.org> sooner than later, since it's no > longer being as actively administered. (Perhaps not at all in fact.) > > On Mon, Sep 25, 2017 at 2:35 PM, Stefan Richthofer > <Ste...@gm... <mailto:Ste...@gm...>> wrote: > > Also observed these errors and additionally I did not receive an > email notification from jython-checkins. > Not that I cared too much for the email notification (still nice > to have), but I suspect the issues could be > related. Or did you receive email notification for recent pushes? > *Gesendet:* Montag, 25. September 2017 um 22:20 Uhr > *Von:* "Jeff Allen" <ja...@fa... <mailto:ja...@fa...>> > *An:* "Jython Developers" <jyt...@li... > <mailto:jyt...@li...>>, > inf...@py... > <mailto:inf...@py...> > *Betreff:* [Jython-dev] Errors when pushing to > hg.python.org/jython <http://hg.python.org/jython> > > Just now got these error messages, actually 4 repeats, one for > each change set: > > PS jython-int> hg push > pushing to ssh://hg...@hg.../jython > <mailto:ssh://hg...@hg.../jython> > searching for changes > remote: adding changesets > remote: adding manifests > remote: adding file changes > remote: added 4 changesets with 28 changes to 25 files > remote: Traceback (most recent call last): > remote: File "/srv/hg/repos/hooks/mail.py", line 166, in incoming > remote: return _incoming(ui, repo, **kwargs) > remote: File "/srv/hg/repos/hooks/mail.py", line 102, in _incoming > remote: diffstat = patch.diffstat(iterlines(diffchunks), > width=60, git=True) > remote: TypeError: diffstat() got an unexpected keyword argument 'git' > remote: error: incoming.notify hook raised an exception: > diffstat() got an unexpected keyword argument 'git' > remote: (run with --traceback for stack trace) > > ... and 3 more the same (from "remote: Traceback ..."). > > It seems to have worked (my change sets landed), but something's > not right at the PSF end. Any ideas? > > Jeff > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! > http://sdm.link/slashdot_______________________________________________ > <http://sdm.link/slashdot_______________________________________________> > Jython-dev mailing list Jyt...@li... > <mailto:Jyt...@li...> > https://lists.sourceforge.net/lists/listinfo/jython-dev > <https://lists.sourceforge.net/lists/listinfo/jython-dev> > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > <mailto:Jyt...@li...> > https://lists.sourceforge.net/lists/listinfo/jython-dev > <https://lists.sourceforge.net/lists/listinfo/jython-dev> > > |
From: Stefan R. <Ste...@gm...> - 2017-09-25 20:59:35
|
Hi all, I refined dicitonary iterator types a bit: https://github.com/jythontools/jython/commit/5b1ed9b0e42dcaa21549ea4a10ee9136c1fb426e Goal is to allow an easier support for iterator types in JyNI (cf. https://github.com/Stewori/JyNI/issues/13). This is fairly internal stuff and does not affect public API, so it shouldn't break anything that is "properly" using Jython API. However, we all know that internal API sometimes is not as internal as one might expect in Java. So, if somebody sees an issue with this, speak up now ;) Main design goal of this change: - Let iterators for values, keys and items be of distinct classes (because CPython has it this way and then it's easier to match in JyNI) - Let the same kind of such iterators from PyDictionary and PyStringMap have a common superclass (defined in AbstractDict) Best, -Stefan |
From: Jim B. <jim...@py...> - 2017-09-25 20:40:33
|
I have also seen this error. I assume that a post-commit hook is being run on the hg server, and it is failing. Not good. This message may be implicitly telling us we need to get off hg.python.org sooner than later, since it's no longer being as actively administered. (Perhaps not at all in fact.) On Mon, Sep 25, 2017 at 2:35 PM, Stefan Richthofer <Ste...@gm... > wrote: > Also observed these errors and additionally I did not receive an email > notification from jython-checkins. > Not that I cared too much for the email notification (still nice to have), > but I suspect the issues could be > related. Or did you receive email notification for recent pushes? > > > *Gesendet:* Montag, 25. September 2017 um 22:20 Uhr > *Von:* "Jeff Allen" <ja...@fa...> > *An:* "Jython Developers" <jyt...@li...>, > inf...@py... > *Betreff:* [Jython-dev] Errors when pushing to hg.python.org/jython > > Just now got these error messages, actually 4 repeats, one for each change > set: > > PS jython-int> hg push > pushing to ssh://hg...@hg.../jython > searching for changes > remote: adding changesets > remote: adding manifests > remote: adding file changes > remote: added 4 changesets with 28 changes to 25 files > remote: Traceback (most recent call last): > remote: File "/srv/hg/repos/hooks/mail.py", line 166, in incoming > remote: return _incoming(ui, repo, **kwargs) > remote: File "/srv/hg/repos/hooks/mail.py", line 102, in _incoming > remote: diffstat = patch.diffstat(iterlines(diffchunks), width=60, > git=True) > remote: TypeError: diffstat() got an unexpected keyword argument 'git' > remote: error: incoming.notify hook raised an exception: diffstat() got an > unexpected keyword argument 'git' > remote: (run with --traceback for stack trace) > > ... and 3 more the same (from "remote: Traceback ..."). > > It seems to have worked (my change sets landed), but something's not right > at the PSF end. Any ideas? > > Jeff > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most engaging > tech sites, Slashdot.org! http://sdm.link/slashdot______ > _________________________________________ Jython-dev mailing list > Jyt...@li... https://lists.sourceforge.net/ > lists/listinfo/jython-dev > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-dev > > |
From: Stefan R. <Ste...@gm...> - 2017-09-25 20:35:20
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Also observed these errors and additionally I did not receive an email notification from jython-checkins.</div> <div>Not that I cared too much for the email notification (still nice to have), but I suspect the issues could be</div> <div>related. Or did you receive email notification for recent pushes?</div> <div> </div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Montag, 25. September 2017 um 22:20 Uhr<br/> <b>Von:</b> "Jeff Allen" <ja...@fa...><br/> <b>An:</b> "Jython Developers" <jyt...@li...>, inf...@py...<br/> <b>Betreff:</b> [Jython-dev] Errors when pushing to hg.python.org/jython</div> <div name="quoted-content"> <div style="background-color: rgb(255,255,255);"> <p>Just now got these error messages, actually 4 repeats, one for each change set:</p> <p>PS jython-int> hg push<br/> pushing to <a class="moz-txt-link-abbreviated" href="mailto:ssh://hg...@hg.../jython" onclick="parent.window.location.href='ssh:\/\/hg...@hg...\/jython'; return false;" target="_blank">ssh://hg...@hg.../jython</a><br/> searching for changes<br/> remote: adding changesets<br/> remote: adding manifests<br/> remote: adding file changes<br/> remote: added 4 changesets with 28 changes to 25 files<br/> remote: Traceback (most recent call last):<br/> remote: File "/srv/hg/repos/hooks/mail.py", line 166, in incoming<br/> remote: return _incoming(ui, repo, **kwargs)<br/> remote: File "/srv/hg/repos/hooks/mail.py", line 102, in _incoming<br/> remote: diffstat = patch.diffstat(iterlines(diffchunks), width=60, git=True)<br/> remote: TypeError: diffstat() got an unexpected keyword argument 'git'<br/> remote: error: incoming.notify hook raised an exception: diffstat() got an unexpected keyword argument 'git'<br/> remote: (run with --traceback for stack trace)</p> <p>... and 3 more the same (from "remote: Traceback ...").</p> <p>It seems to have worked (my change sets landed), but something's not right at the PSF end. Any ideas?</p> <p>Jeff</p> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! <a href="http://sdm.link/slashdot_______________________________________________" target="_blank">http://sdm.link/slashdot_______________________________________________</a> Jython-dev mailing list Jyt...@li... <a href="https://lists.sourceforge.net/lists/listinfo/jython-dev" target="_blank">https://lists.sourceforge.net/lists/listinfo/jython-dev</a></div> </div> </div> </div> </div></div></body></html> |
From: Jeff A. <ja...@fa...> - 2017-09-25 20:20:16
|
Just now got these error messages, actually 4 repeats, one for each change set: PS jython-int> hg push pushing to ssh://hg...@hg.../jython searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 4 changesets with 28 changes to 25 files remote: Traceback (most recent call last): remote: File "/srv/hg/repos/hooks/mail.py", line 166, in incoming remote: return _incoming(ui, repo, **kwargs) remote: File "/srv/hg/repos/hooks/mail.py", line 102, in _incoming remote: diffstat = patch.diffstat(iterlines(diffchunks), width=60, git=True) remote: TypeError: diffstat() got an unexpected keyword argument 'git' remote: error: incoming.notify hook raised an exception: diffstat() got an unexpected keyword argument 'git' remote: (run with --traceback for stack trace) ... and 3 more the same (from "remote: Traceback ..."). It seems to have worked (my change sets landed), but something's not right at the PSF end. Any ideas? Jeff |
From: Jeff A. <ja...@fa...> - 2017-09-24 18:32:10
|
Stefan: Sincere felicitations on your progress this GSoC. I think we all know people who would love to use C extensions with Jython and we can't rewrite them all in Java. Jeff On 23/09/2017 18:03, Stefan Richthofer wrote: > With JyNI alpha 5, I proudly announce the first version of JyNI that > also runs on Windows. > > JyNI is a layer that allows Jython to load native CPython extensions. > Most notably ctypes and NumPy are already workable (core functionality). > > > Take a look at > > jyni.org > > or go directly to the release: > > https://github.com/Stewori/JyNI/releases/tag/v2.7-alpha.5 > > > Binaries are provided for Linux, OS X and Windows. > It should in principle also work on other POSIX platforms. > > > > NumPy support > ------------- > > >From JyNI alpha 4 onwards, some NumPy support is available. > For JyNI alpha 5 featuring Windows support, we explicitly asserted that > NumPy works on Windows equally well as on Linux and OS X, > i.e. up to known limitations. > > For details about NumPy support see > > https://github.com/Stewori/JyNI/releases/tag/v2.7-alpha.4 > https://github.com/Stewori/JyNI/issues/2 > > > > Google Summer of Code > --------------------- > > JyNI alpha 5 was mainly developed within a Google Summer of Code project: > > https://summerofcode.withgoogle.com/projects/#4931062149939200 > http://gsoc2017-jyni.blogspot.de for details. > > > > What comes next? > ---------------- > > The Python C API is not yet fully supported. A major goal for the next > release is to add support for the buffer protocol, which is currently > blocking support for SciPy and various other extensions. > > > > Enjoy! > > > -Stefan > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-dev > |
From: Jeff A. <ja...@fa...> - 2017-09-24 18:13:33
|
Thanks Jim. I'm working on presenting this as a reduced number of commits to make the change easier to follow. I'll strip out the debug too. After so many weeks, I shall miss it, but it's too in-your-face. If we need it again, it will be on Bitbucket for a while. +1 for an early 2.7.2: we should make a short list of blockers on its own thread. Jeff On 24/09/2017 17:18, Jim Baker wrote: > Likewise, glad to see it was just a problem in the test setup. > Everything looks good now: the test demonstrates that the Python type > mapping does not prevent class GC, assuming nothing else refers to the > Java class. Indeed the earlier faulty version of the test further > demonstrates that point, given the parent classloader referring to the > class, and preventing GC. > > I have also had a chance to review the rest of the change set, and > everything else looks great. In particular, I like how you have > removed the need to support the hack for hardRef, along with the > management of deferred initialization of types. > > Let's merge this code in, given that it's a substantial improvement > over the old implementation, with all tests passing. We should > consider releasing a 2.7.2 soon, since this and related changes has > fixed serious problems in re and other mixed usage of Java and Python > via callbacks (http://bugs.jython.org/issue2609). Getting this out > would then allow us to work on Java 9 support in 2.7.3, as well as > fixing up sys slowness and related jsr223 (hopefully!). > > - Jim > > > > On Sun, Sep 24, 2017 at 3:19 AM, Jeff Allen <ja...@fa... > <mailto:ja...@fa...>> wrote: > > As I suspected, the critical distinction is between the > *initiating* class loader and the *defining* class loader. > > The defining class loader here turns out to be an instance of > sun.misc.Launcher$AppClassLoader, the grandparent of our > URLClassLoader that gets consulted before it tries the JAR URL we > gave. org.python.tests.Callbacker appears in jython-dev.jar, so it > is found there first. This is the same loader that holds PyObject, > etc., so essentially permanent and keeps our test class alive. > > When this is all fixed by making the parent explicitly None in > make_jar_classloader, everything is GC'd as we'd hope. (Phew!) > > https://bitbucket.org/tournesol/jython-fgtype/commits/4fd2baafb7499929f876ac20a607511668b3e222 > <https://bitbucket.org/tournesol/jython-fgtype/commits/4fd2baafb7499929f876ac20a607511668b3e222> > > Jeff > > > > On 18/09/2017 00:45, Jim Baker wrote: >> Jeff, >> >> I looked at the new test, and it's interesting to see the >> ClassLoader gets collected, but not the corresponding PyJavaType. >> To me this implies the Class was necessarily collected; but it's >> not observable directly in Python code. While you are busy on >> other things, I will try playing with this changeset some more to >> see what is going on here. Maybe it ends just being a simple >> question of setting up a ref queue on Class GC and calling >> ClassValue#remove. >> >> It's rather awesome about the simplification of fromClass, and >> removing the separate implementation of fromClassSkippingInners. >> >> - Jim >> >> On Sun, Sep 17, 2017 at 2:41 AM, Jeff Allen <ja...@fa... >> <mailto:ja...@fa...>> wrote: >> >> Jim: >> >> I figured out needsInners (I think!) and how I could make >> fromClass and fromClassSkippingInners into one method using >> the state of the registry to steer the action to be almost >> the same -- and reach the same conclusion -- with a net >> reduction in code. >> >> https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc1f52c9b3733841b375831f8a3c0d27a93e >> <https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc1f52c9b3733841b375831f8a3c0d27a93e> >> >> I have added a test to prove the PyType (actually PyJavaType) >> is GC'd when we cease to reference it, using >> make_jar_classloader, but it is presently failing. Applied >> retrospectively to successive change sets it begins to fail >> exactly where I introduce ClassValue. :( >> >> Maybe ClassValue doesn't quite work as I thought. Or I'm >> still not using it as John Rose intended. It seems wrong we >> should have to layer weak references on top or have some kind >> of removal queue. >> >> I tried visualvm to see where it might be referenced, but I'm >> not sure how to interpret what it's telling me. However, this >> week, and maybe longer, other things have priority. Ideas >> welcome for when I'm back to this. >> >> For exposed PyObjects, I'm pretty sure classToBuilder always >> was keeping a strong reference that would keep them alive >> now. (But not for the type under test.) I've removed this >> effect. But maybe we don't mind that? >> https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc1f52c9b3733841b375831f8a3c0d27a93e#Lsrc/org/python/core/PyType.javaT1208 >> <https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc1f52c9b3733841b375831f8a3c0d27a93e#Lsrc/org/python/core/PyType.javaT1208> >> >> Jeff >> >> >> On 12/09/2017 01:37, Jim Baker wrote: >>> [I'm been having some problem posting to the jython-dev >>> mailing list, let's see if this response gets through!] >>> >>> On Mon, Sep 11, 2017 at 1:47 PM, Jeff Allen >>> <ja...@fa... <mailto:ja...@fa...>> wrote: >>> >>> Jim: >>> >>> Thanks for the pointers. I agree with you on #2 that >>> what I've got *should* behave correctly with class >>> loaders, but is there a test you can suggest (or one >>> I've missed) that conclusively demonstrates it? >>> >>> >>> So I would start with test_support.make_jar_classloader, >>> just because it's easier to test this behavior in Python. >>> test_classpathimporter seems to use this support >>> functionality nicely. >>> >>> If we want to add testing of our expectations around >>> ClassValue's lifetime, we can also add some sort of weakref >>> scheme, in conjunction with a multi-round GC, to verify that >>> the PyType gets collected as expected. Of course we should >>> expect ClassValue to behave as expected, but this would >>> ensure we are not holding anything, now or in the future >>> implementation, in the Jython runtime that would violate >>> this contract. >>> >>> >>> I'll press in on the question of inners. I tried just >>> calling fromClass, but it fails when the inner extends >>> the outer (test_import_jy:: test_selfreferential_classes >>> fails). You have to initialise the outer, then visit the >>> inners. In a way, it's the PyJavaType counterpart of the >>> deferred initialisation of exposed types that we control >>> by identifying bootstrap types. But here it has to be >>> self-guiding. >>> >>> I have an idea that if I can make fromClass and >>> fromClassSkippingInners the same thing, then that can >>> become the implementation classToValue.computeValue, and >>> I won't need the NotReady exception or findExistingType. >>> >>> >>> So Java classes can form a general type graph (directed, >>> with cycles). It seems to me that the NotReady acts as some >>> sort of coloring in the graph exploration that fromClass is >>> doing. But as I said, I find this code for inner classes >>> rather subtle! Good luck in your coding here, it would be >>> really nice to get some further simplification. >>> >>> >>> Jeff >>> >>> On 10/09/2017 01:12, Jim Baker wrote: >>> >>> Thanks for working on this change set, it's really >>> good stuff. In particular, that's a very nice >>> handoff you do in the PyType.Registry class, >>> specifically moving computed types from >>> classToNewType to classToType; and managing the >>> NotReady state. Perhaps it needs some sort of state >>> diagram to illustrate, but as someone who has been >>> in that code, it makes perfect sense. >>> >>> With respect to GC, the following should be the case: >>> >>> * As long as the ClassLoader for the mapped Java >>> class instance C is >>> around, the corresponding PyType instance T will >>> live. This >>> follows from the definition of ClassValue as you >>> point out in the >>> code comments. (Good!) >>> * As long as Python code holds a hard ref to T, >>> the corresponding C >>> will live. (Good!) (So we would see this in from >>> `some_java_pkg >>> import baz`; and it follows from the >>> underlying_class field >>> holding a hard ref from T to C.) >>> * As long as Python code holds a hard ref to an >>> instance of C, the >>> corresponding T will also live. (Good!) >>> >>> Otherwise, this mapping will allow for GC of T, and >>> subsequently of C, per the definition of ClassValue. >>> I was also looking at Groovy's usage of a similar >>> mapping, and corresponding bug, >>> https://bugs.openjdk.java.net/browse/JDK-8136353 >>> <https://bugs.openjdk.java.net/browse/JDK-8136353>, >>> and it looks like the problem reported there doesn't >>> hold. This is because there are no strong refs >>> outside of PyType itself. >>> >>> So everything looks good for getting this change in. >>> >>> On Sat, Sep 9, 2017 at 2:12 PM, Jeff Allen >>> <ja...@fa... <mailto:ja...@fa...> >>> <mailto:ja...@fa... >>> <mailto:ja...@fa...>>> wrote: >>> >>> Jim, all: >>> >>> By a series of small steps I've come quite a >>> long way in this >>> aspect of PyType. It might be worth a look. >>> https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd >>> <https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd> >>> >>> <https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd >>> <https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd>> >>> >>> In this last commit I've entirely dispensed with >>> any long-term >>> reference to the created PyType in the type >>> registry: only the >>> ClassValue holds one. The explicit management of >>> reachability goes >>> away and we have just the behaviour given us by >>> ClassValue. The >>> only down-side I see is that a PyType created >>> for a Java class you >>> handle briefly from Python will not be >>> collectable until the class is. >>> >>> The old test for weakness, which I've been >>> running in parallel >>> with the new, requires PyType.getClassToType(), >>> and can no longer >>> be supported. (You can't enumerate the >>> ClassValue.) I believe the >>> replacement tests the same thing -- they used to >>> pass and fail >>> together. >>> >>> >>> Right, it makes sense to remove this test. This is >>> because we don't want to support the necessary >>> mapping, even though it could be readily supported >>> with an appropriate concurrent weak mapping - the >>> only semantics it would be supporting is for this >>> very test. >>> >>> >>> I've moved some actions around, and removed some >>> of the checks. We >>> seemingly expected the desired PyType to be >>> created at any moment >>> by a side effect. Reason and regression testing >>> tell me that >>> doesn't happen in the new arrangement. I think >>> there is slightly >>> less code to execute, but masses more comment >>> and debug -- it's my >>> way of figuring it out. It's all very educational. >>> >>> I still don't understand: >>> >>> 1. Whether we find the downside (PyType not GC'd >>> until the class is) >>> important. >>> >>> >>> So we do know that Jython will continue to work if >>> we remove a mapping entry, since it happens all the >>> time currently in some code like json, re, and >>> socket, where classes are not directly imported :) >>> We could always do some sort of LRU and then call >>> ClassValue#remove, but I don't think it makes sense. >>> There are many other other optimizations in the >>> runtime first. >>> >>> 2. Whether I have broken something that the >>> regression tests don't >>> cover (like use with isolating class loaders). >>> >>> >>> These are different Java classes if in different >>> class loaders. For Python usage of these Java >>> classes, it's all the same, thanks to duck typing, >>> but we need to maintain a different mapping entry. >>> Again #1 demonstrates we have been handling this >>> correctly in the current codebase. >>> >>> 3. What needsInners is really up to. I see >>> *what* it does, but not >>> *why* well enough to consider alternatives. >>> It would simplify >>> computeValue if there were no >>> fromClassSkippingInners: could >>> needsInners be a registry global? And why do >>> we skip processing >>> them, when we do? >>> >>> >>> That codepath is exceedingly subtle, at least to me. >>> But it would be an interesting experiment to see if >>> it could be made global, vs this potentially >>> expanding context that is passed through. >>> >>> - Jim >>> >>> >>> >> >> > > |
From: Jim B. <jim...@py...> - 2017-09-24 16:48:30
|
Likewise, glad to see it was just a problem in the test setup. Everything looks good now: the test demonstrates that the Python type mapping does not prevent class GC, assuming nothing else refers to the Java class. Indeed the earlier faulty version of the test further demonstrates that point, given the parent classloader referring to the class, and preventing GC. I have also had a chance to review the rest of the change set, and everything else looks great. In particular, I like how you have removed the need to support the hack for hardRef, along with the management of deferred initialization of types. Let's merge this code in, given that it's a substantial improvement over the old implementation, with all tests passing. We should consider releasing a 2.7.2 soon, since this and related changes has fixed serious problems in re and other mixed usage of Java and Python via callbacks ( http://bugs.jython.org/issue2609). Getting this out would then allow us to work on Java 9 support in 2.7.3, as well as fixing up sys slowness and related jsr223 (hopefully!). - Jim On Sun, Sep 24, 2017 at 3:19 AM, Jeff Allen <ja...@fa...> wrote: > As I suspected, the critical distinction is between the *initiating* > class loader and the *defining* class loader. > > The defining class loader here turns out to be an instance of > sun.misc.Launcher$AppClassLoader, the grandparent of our URLClassLoader > that gets consulted before it tries the JAR URL we gave. > org.python.tests.Callbacker appears in jython-dev.jar, so it is found there > first. This is the same loader that holds PyObject, etc., so essentially > permanent and keeps our test class alive. > > When this is all fixed by making the parent explicitly None in > make_jar_classloader, everything is GC'd as we'd hope. (Phew!) > > https://bitbucket.org/tournesol/jython-fgtype/commits/ > 4fd2baafb7499929f876ac20a607511668b3e222 > Jeff > > > > On 18/09/2017 00:45, Jim Baker wrote: > > Jeff, > > I looked at the new test, and it's interesting to see the ClassLoader gets > collected, but not the corresponding PyJavaType. To me this implies the > Class was necessarily collected; but it's not observable directly in Python > code. While you are busy on other things, I will try playing with this > changeset some more to see what is going on here. Maybe it ends just being > a simple question of setting up a ref queue on Class GC and calling > ClassValue#remove. > > It's rather awesome about the simplification of fromClass, and removing > the separate implementation of fromClassSkippingInners. > > - Jim > > On Sun, Sep 17, 2017 at 2:41 AM, Jeff Allen <ja...@fa...> wrote: > >> Jim: >> >> I figured out needsInners (I think!) and how I could make fromClass and >> fromClassSkippingInners into one method using the state of the registry to >> steer the action to be almost the same -- and reach the same conclusion -- >> with a net reduction in code. >> >> https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc >> 1f52c9b3733841b375831f8a3c0d27a93e >> >> I have added a test to prove the PyType (actually PyJavaType) is GC'd >> when we cease to reference it, using make_jar_classloader, but it is >> presently failing. Applied retrospectively to successive change sets it >> begins to fail exactly where I introduce ClassValue. :( >> Maybe ClassValue doesn't quite work as I thought. Or I'm still not using >> it as John Rose intended. It seems wrong we should have to layer weak >> references on top or have some kind of removal queue. >> >> I tried visualvm to see where it might be referenced, but I'm not sure >> how to interpret what it's telling me. However, this week, and maybe >> longer, other things have priority. Ideas welcome for when I'm back to this. >> For exposed PyObjects, I'm pretty sure classToBuilder always was keeping >> a strong reference that would keep them alive now. (But not for the type >> under test.) I've removed this effect. But maybe we don't mind that? >> https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc >> 1f52c9b3733841b375831f8a3c0d27a93e#Lsrc/org/python/core/PyType.javaT1208 >> >> Jeff >> >> >> On 12/09/2017 01:37, Jim Baker wrote: >> >> [I'm been having some problem posting to the jython-dev mailing list, >> let's see if this response gets through!] >> >> On Mon, Sep 11, 2017 at 1:47 PM, Jeff Allen <ja...@fa...> wrote: >> >>> Jim: >>> >>> Thanks for the pointers. I agree with you on #2 that what I've got >>> *should* behave correctly with class loaders, but is there a test you can >>> suggest (or one I've missed) that conclusively demonstrates it? >>> >> >> So I would start with test_support.make_jar_classloader, just because >> it's easier to test this behavior in Python. test_classpathimporter seems >> to use this support functionality nicely. >> >> If we want to add testing of our expectations around ClassValue's >> lifetime, we can also add some sort of weakref scheme, in conjunction with >> a multi-round GC, to verify that the PyType gets collected as expected. Of >> course we should expect ClassValue to behave as expected, but this would >> ensure we are not holding anything, now or in the future implementation, in >> the Jython runtime that would violate this contract. >> >> >>> I'll press in on the question of inners. I tried just calling fromClass, >>> but it fails when the inner extends the outer (test_import_jy:: >>> test_selfreferential_classes fails). You have to initialise the outer, then >>> visit the inners. In a way, it's the PyJavaType counterpart of the deferred >>> initialisation of exposed types that we control by identifying bootstrap >>> types. But here it has to be self-guiding. >>> >>> I have an idea that if I can make fromClass and fromClassSkippingInners >>> the same thing, then that can become the implementation >>> classToValue.computeValue, and I won't need the NotReady exception or >>> findExistingType. >>> >> >> So Java classes can form a general type graph (directed, with cycles). It >> seems to me that the NotReady acts as some sort of coloring in the graph >> exploration that fromClass is doing. But as I said, I find this code for >> inner classes rather subtle! Good luck in your coding here, it would be >> really nice to get some further simplification. >> >> >>> >>> Jeff >>> >>> On 10/09/2017 01:12, Jim Baker wrote: >>> >>>> Thanks for working on this change set, it's really good stuff. In >>>> particular, that's a very nice handoff you do in the PyType.Registry class, >>>> specifically moving computed types from classToNewType to classToType; and >>>> managing the NotReady state. Perhaps it needs some sort of state diagram to >>>> illustrate, but as someone who has been in that code, it makes perfect >>>> sense. >>>> >>>> With respect to GC, the following should be the case: >>>> >>>> * As long as the ClassLoader for the mapped Java class instance C is >>>> around, the corresponding PyType instance T will live. This >>>> follows from the definition of ClassValue as you point out in the >>>> code comments. (Good!) >>>> * As long as Python code holds a hard ref to T, the corresponding C >>>> will live. (Good!) (So we would see this in from `some_java_pkg >>>> import baz`; and it follows from the underlying_class field >>>> holding a hard ref from T to C.) >>>> * As long as Python code holds a hard ref to an instance of C, the >>>> corresponding T will also live. (Good!) >>>> >>>> Otherwise, this mapping will allow for GC of T, and subsequently of C, >>>> per the definition of ClassValue. I was also looking at Groovy's usage of a >>>> similar mapping, and corresponding bug, https://bugs.openjdk.java.net/ >>>> browse/JDK-8136353, and it looks like the problem reported there >>>> doesn't hold. This is because there are no strong refs outside of PyType >>>> itself. >>>> >>>> So everything looks good for getting this change in. >>>> >>>> On Sat, Sep 9, 2017 at 2:12 PM, Jeff Allen <ja...@fa... <mailto: >>>> ja...@fa...>> wrote: >>>> >>>> Jim, all: >>>> >>>> By a series of small steps I've come quite a long way in this >>>> aspect of PyType. It might be worth a look. >>>> https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8 >>>> ff48bf5d20cb57169cd3f43a3cd90df0cd >>>> <https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d >>>> 8ff48bf5d20cb57169cd3f43a3cd90df0cd> >>>> >>>> In this last commit I've entirely dispensed with any long-term >>>> reference to the created PyType in the type registry: only the >>>> ClassValue holds one. The explicit management of reachability goes >>>> away and we have just the behaviour given us by ClassValue. The >>>> only down-side I see is that a PyType created for a Java class you >>>> handle briefly from Python will not be collectable until the class >>>> is. >>>> >>>> The old test for weakness, which I've been running in parallel >>>> with the new, requires PyType.getClassToType(), and can no longer >>>> be supported. (You can't enumerate the ClassValue.) I believe the >>>> replacement tests the same thing -- they used to pass and fail >>>> together. >>>> >>>> >>>> Right, it makes sense to remove this test. This is because we don't >>>> want to support the necessary mapping, even though it could be readily >>>> supported with an appropriate concurrent weak mapping - the only semantics >>>> it would be supporting is for this very test. >>>> >>>> >>>> I've moved some actions around, and removed some of the checks. We >>>> seemingly expected the desired PyType to be created at any moment >>>> by a side effect. Reason and regression testing tell me that >>>> doesn't happen in the new arrangement. I think there is slightly >>>> less code to execute, but masses more comment and debug -- it's my >>>> way of figuring it out. It's all very educational. >>>> >>>> I still don't understand: >>>> >>>> 1. Whether we find the downside (PyType not GC'd until the class is) >>>> important. >>>> >>>> >>>> So we do know that Jython will continue to work if we remove a mapping >>>> entry, since it happens all the time currently in some code like json, re, >>>> and socket, where classes are not directly imported :) We could always do >>>> some sort of LRU and then call ClassValue#remove, but I don't think it >>>> makes sense. There are many other other optimizations in the runtime first. >>>> >>>> 2. Whether I have broken something that the regression tests don't >>>> cover (like use with isolating class loaders). >>>> >>>> >>>> These are different Java classes if in different class loaders. For >>>> Python usage of these Java classes, it's all the same, thanks to duck >>>> typing, but we need to maintain a different mapping entry. Again #1 >>>> demonstrates we have been handling this correctly in the current codebase. >>>> >>>> 3. What needsInners is really up to. I see *what* it does, but not >>>> *why* well enough to consider alternatives. It would simplify >>>> computeValue if there were no fromClassSkippingInners: could >>>> needsInners be a registry global? And why do we skip processing >>>> them, when we do? >>>> >>>> >>>> That codepath is exceedingly subtle, at least to me. But it would be an >>>> interesting experiment to see if it could be made global, vs this >>>> potentially expanding context that is passed through. >>>> >>>> - Jim >>>> >>> >>> >> >> > > |
From: Jeff A. <ja...@fa...> - 2017-09-24 09:19:59
|
As I suspected, the critical distinction is between the *initiating* class loader and the *defining* class loader. The defining class loader here turns out to be an instance of sun.misc.Launcher$AppClassLoader, the grandparent of our URLClassLoader that gets consulted before it tries the JAR URL we gave. org.python.tests.Callbacker appears in jython-dev.jar, so it is found there first. This is the same loader that holds PyObject, etc., so essentially permanent and keeps our test class alive. When this is all fixed by making the parent explicitly None in make_jar_classloader, everything is GC'd as we'd hope. (Phew!) https://bitbucket.org/tournesol/jython-fgtype/commits/4fd2baafb7499929f876ac20a607511668b3e222 Jeff On 18/09/2017 00:45, Jim Baker wrote: > Jeff, > > I looked at the new test, and it's interesting to see the ClassLoader > gets collected, but not the corresponding PyJavaType. To me this > implies the Class was necessarily collected; but it's not observable > directly in Python code. While you are busy on other things, I will > try playing with this changeset some more to see what is going on > here. Maybe it ends just being a simple question of setting up a ref > queue on Class GC and calling ClassValue#remove. > > It's rather awesome about the simplification of fromClass, and > removing the separate implementation of fromClassSkippingInners. > > - Jim > > On Sun, Sep 17, 2017 at 2:41 AM, Jeff Allen <ja...@fa... > <mailto:ja...@fa...>> wrote: > > Jim: > > I figured out needsInners (I think!) and how I could make > fromClass and fromClassSkippingInners into one method using the > state of the registry to steer the action to be almost the same -- > and reach the same conclusion -- with a net reduction in code. > > https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc1f52c9b3733841b375831f8a3c0d27a93e > <https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc1f52c9b3733841b375831f8a3c0d27a93e> > > I have added a test to prove the PyType (actually PyJavaType) is > GC'd when we cease to reference it, using make_jar_classloader, > but it is presently failing. Applied retrospectively to successive > change sets it begins to fail exactly where I introduce ClassValue. :( > > Maybe ClassValue doesn't quite work as I thought. Or I'm still not > using it as John Rose intended. It seems wrong we should have to > layer weak references on top or have some kind of removal queue. > > I tried visualvm to see where it might be referenced, but I'm not > sure how to interpret what it's telling me. However, this week, > and maybe longer, other things have priority. Ideas welcome for > when I'm back to this. > > For exposed PyObjects, I'm pretty sure classToBuilder always was > keeping a strong reference that would keep them alive now. (But > not for the type under test.) I've removed this effect. But maybe > we don't mind that? > https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc1f52c9b3733841b375831f8a3c0d27a93e#Lsrc/org/python/core/PyType.javaT1208 > <https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc1f52c9b3733841b375831f8a3c0d27a93e#Lsrc/org/python/core/PyType.javaT1208> > > Jeff > > > On 12/09/2017 01:37, Jim Baker wrote: >> [I'm been having some problem posting to the jython-dev mailing >> list, let's see if this response gets through!] >> >> On Mon, Sep 11, 2017 at 1:47 PM, Jeff Allen <ja...@fa... >> <mailto:ja...@fa...>> wrote: >> >> Jim: >> >> Thanks for the pointers. I agree with you on #2 that what >> I've got *should* behave correctly with class loaders, but is >> there a test you can suggest (or one I've missed) that >> conclusively demonstrates it? >> >> >> So I would start with test_support.make_jar_classloader, just >> because it's easier to test this behavior in Python. >> test_classpathimporter seems to use this support functionality >> nicely. >> >> If we want to add testing of our expectations around ClassValue's >> lifetime, we can also add some sort of weakref scheme, in >> conjunction with a multi-round GC, to verify that the PyType gets >> collected as expected. Of course we should expect ClassValue to >> behave as expected, but this would ensure we are not holding >> anything, now or in the future implementation, in the Jython >> runtime that would violate this contract. >> >> >> I'll press in on the question of inners. I tried just calling >> fromClass, but it fails when the inner extends the outer >> (test_import_jy:: test_selfreferential_classes fails). You >> have to initialise the outer, then visit the inners. In a >> way, it's the PyJavaType counterpart of the deferred >> initialisation of exposed types that we control by >> identifying bootstrap types. But here it has to be self-guiding. >> >> I have an idea that if I can make fromClass and >> fromClassSkippingInners the same thing, then that can become >> the implementation classToValue.computeValue, and I won't >> need the NotReady exception or findExistingType. >> >> >> So Java classes can form a general type graph (directed, with >> cycles). It seems to me that the NotReady acts as some sort of >> coloring in the graph exploration that fromClass is doing. But as >> I said, I find this code for inner classes rather subtle! Good >> luck in your coding here, it would be really nice to get some >> further simplification. >> >> >> Jeff >> >> On 10/09/2017 01:12, Jim Baker wrote: >> >> Thanks for working on this change set, it's really good >> stuff. In particular, that's a very nice handoff you do >> in the PyType.Registry class, specifically moving >> computed types from classToNewType to classToType; and >> managing the NotReady state. Perhaps it needs some sort >> of state diagram to illustrate, but as someone who has >> been in that code, it makes perfect sense. >> >> With respect to GC, the following should be the case: >> >> * As long as the ClassLoader for the mapped Java class >> instance C is >> around, the corresponding PyType instance T will >> live. This >> follows from the definition of ClassValue as you >> point out in the >> code comments. (Good!) >> * As long as Python code holds a hard ref to T, the >> corresponding C >> will live. (Good!) (So we would see this in from >> `some_java_pkg >> import baz`; and it follows from the underlying_class >> field >> holding a hard ref from T to C.) >> * As long as Python code holds a hard ref to an >> instance of C, the >> corresponding T will also live. (Good!) >> >> Otherwise, this mapping will allow for GC of T, and >> subsequently of C, per the definition of ClassValue. I >> was also looking at Groovy's usage of a similar mapping, >> and corresponding bug, >> https://bugs.openjdk.java.net/browse/JDK-8136353 >> <https://bugs.openjdk.java.net/browse/JDK-8136353>, and >> it looks like the problem reported there doesn't hold. >> This is because there are no strong refs outside of >> PyType itself. >> >> So everything looks good for getting this change in. >> >> On Sat, Sep 9, 2017 at 2:12 PM, Jeff Allen >> <ja...@fa... <mailto:ja...@fa...> >> <mailto:ja...@fa... <mailto:ja...@fa...>>> >> wrote: >> >> Jim, all: >> >> By a series of small steps I've come quite a long way >> in this >> aspect of PyType. It might be worth a look. >> https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd >> <https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd> >> >> <https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd >> <https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd>> >> >> In this last commit I've entirely dispensed with any >> long-term >> reference to the created PyType in the type registry: >> only the >> ClassValue holds one. The explicit management of >> reachability goes >> away and we have just the behaviour given us by >> ClassValue. The >> only down-side I see is that a PyType created for a >> Java class you >> handle briefly from Python will not be collectable >> until the class is. >> >> The old test for weakness, which I've been running in >> parallel >> with the new, requires PyType.getClassToType(), and >> can no longer >> be supported. (You can't enumerate the ClassValue.) I >> believe the >> replacement tests the same thing -- they used to pass >> and fail >> together. >> >> >> Right, it makes sense to remove this test. This is >> because we don't want to support the necessary mapping, >> even though it could be readily supported with an >> appropriate concurrent weak mapping - the only semantics >> it would be supporting is for this very test. >> >> >> I've moved some actions around, and removed some of >> the checks. We >> seemingly expected the desired PyType to be created >> at any moment >> by a side effect. Reason and regression testing tell >> me that >> doesn't happen in the new arrangement. I think there >> is slightly >> less code to execute, but masses more comment and >> debug -- it's my >> way of figuring it out. It's all very educational. >> >> I still don't understand: >> >> 1. Whether we find the downside (PyType not GC'd >> until the class is) >> important. >> >> >> So we do know that Jython will continue to work if we >> remove a mapping entry, since it happens all the time >> currently in some code like json, re, and socket, where >> classes are not directly imported :) We could always do >> some sort of LRU and then call ClassValue#remove, but I >> don't think it makes sense. There are many other other >> optimizations in the runtime first. >> >> 2. Whether I have broken something that the >> regression tests don't >> cover (like use with isolating class loaders). >> >> >> These are different Java classes if in different class >> loaders. For Python usage of these Java classes, it's all >> the same, thanks to duck typing, but we need to maintain >> a different mapping entry. Again #1 demonstrates we have >> been handling this correctly in the current codebase. >> >> 3. What needsInners is really up to. I see *what* it >> does, but not >> *why* well enough to consider alternatives. It >> would simplify >> computeValue if there were no >> fromClassSkippingInners: could >> needsInners be a registry global? And why do we >> skip processing >> them, when we do? >> >> >> That codepath is exceedingly subtle, at least to me. But >> it would be an interesting experiment to see if it could >> be made global, vs this potentially expanding context >> that is passed through. >> >> - Jim >> >> >> > > |
From: Stefan R. <Ste...@gm...> - 2017-09-23 17:04:00
|
With JyNI alpha 5, I proudly announce the first version of JyNI that also runs on Windows. JyNI is a layer that allows Jython to load native CPython extensions. Most notably ctypes and NumPy are already workable (core functionality). Take a look at jyni.org or go directly to the release: https://github.com/Stewori/JyNI/releases/tag/v2.7-alpha.5 Binaries are provided for Linux, OS X and Windows. It should in principle also work on other POSIX platforms. NumPy support ------------- >From JyNI alpha 4 onwards, some NumPy support is available. For JyNI alpha 5 featuring Windows support, we explicitly asserted that NumPy works on Windows equally well as on Linux and OS X, i.e. up to known limitations. For details about NumPy support see https://github.com/Stewori/JyNI/releases/tag/v2.7-alpha.4 https://github.com/Stewori/JyNI/issues/2 Google Summer of Code --------------------- JyNI alpha 5 was mainly developed within a Google Summer of Code project: https://summerofcode.withgoogle.com/projects/#4931062149939200 http://gsoc2017-jyni.blogspot.de for details. What comes next? ---------------- The Python C API is not yet fully supported. A major goal for the next release is to add support for the buffer protocol, which is currently blocking support for SciPy and various other extensions. Enjoy! -Stefan |
From: Jython t. <st...@bu...> - 2017-09-22 16:10:23
|
ACTIVITY SUMMARY (2017-09-15 - 2017-09-22) Jython tracker at http://bugs.jython.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open 317 ( +0) closed 2327 ( +0) total 2644 ( +0) Open issues with patches: 28 Most recent 15 issues with no replies (15) ========================================== #2618: socket.sendall no longer sends all http://bugs.jython.org/issue2618 #2616: Incomplete / broken support for Certificate Revocation Lists http://bugs.jython.org/issue2616 #2613: 2.7.1 MANIFEST.MF contains unfilled placeholders http://bugs.jython.org/issue2613 #2611: mkdir() operation in /Lib/os.py has different behavior when ru http://bugs.jython.org/issue2611 #2606: jython launch problem sun.misc.InvalidJarIndexException http://bugs.jython.org/issue2606 #2605: Jython 2.7.0 startup performance regression http://bugs.jython.org/issue2605 #2591: Unable to execute directory or zip file (test_cmd_line_script) http://bugs.jython.org/issue2591 #2567: System state lost during JSR-223 initialisation http://bugs.jython.org/issue2567 #2562: Windows: OSError: unlink(): an unknown error occurred http://bugs.jython.org/issue2562 #2531: Support SNI for SSL/TLS server sockets http://bugs.jython.org/issue2531 #2525: Jython incorrectly buffers file pipe output with Subprocess(co http://bugs.jython.org/issue2525 #2520: Jython does NOT support socket.listen(0) for accepting only on http://bugs.jython.org/issue2520 #2512: Values in built-in modules's __dict__ are â<reflected field http://bugs.jython.org/issue2512 #2507: Run "invokeFunction" in a thread does not inherit the "ScriptC http://bugs.jython.org/issue2507 #2494: Support for pydoc_data http://bugs.jython.org/issue2494 Most recent 15 issues waiting for review (15) ============================================= #2566: inspect does not recognize code objects from bytecode files http://bugs.jython.org/issue2566 #2545: help() does not work on Java-implemented modules http://bugs.jython.org/issue2545 #2429: cStringIO does not work with mutable objects implementing the http://bugs.jython.org/issue2429 #2367: Jython ignores custom __eq__ when hashing dict subclasses http://bugs.jython.org/issue2367 #2330: full-build fails to copy CPython License http://bugs.jython.org/issue2330 #2230: Jython evaluation blocks under heavy load with high multi-core http://bugs.jython.org/issue2230 #2143: site-packages support in standalone jar http://bugs.jython.org/issue2143 #2142: Set Thread classloader when entering Jython context http://bugs.jython.org/issue2142 #2121: Jython jar on Maven central embeds other third party libraries http://bugs.jython.org/issue2121 #2077: marshal doesn't raise error when fed unmarshalable object http://bugs.jython.org/issue2077 #1925: Support loading java.sql.Drivers that aren't on the boot class http://bugs.jython.org/issue1925 #1917: No ctypes.c_char http://bugs.jython.org/issue1917 #1866: Parser does not have mismatch token error messages caught by B http://bugs.jython.org/issue1866 #1842: Add IBM i support to Jython http://bugs.jython.org/issue1842 #1796: Jython doesn't support jar dir with colon's in it http://bugs.jython.org/issue1796 |
From: Rory O'D. <ror...@or...> - 2017-09-21 20:37:08
|
Hi Alan, Three items to share with you today * *JDK 9 General Availability * o GPL'd binaries from Oracle are available here: + http://jdk.java.net/9 o See Mark Reinhold's email for more details on the Release [1] + delivery of Project Jigsaw [2] * Are you JDK 9 Ready ? o The Quality Outreach wiki has been updated to include a JDK 9 Ready column. o If you would like us to identify your project as JDK 9 ready , please let me know and I will add it to the wiki. * Quality Outreach Report for September 2017**is available o many thanks for your continued support and welcome to the new projects! Rgds,Rory [1] http://mail.openjdk.java.net/pipermail/announce/2017-September/000230.html [2] https://mreinhold.org/blog/jigsaw-complete -- Rgds,Rory O'Donnell Quality Engineering Manager Oracle EMEA , Dublin, Ireland |
From: Jim B. <jim...@py...> - 2017-09-17 23:46:11
|
Jeff, I looked at the new test, and it's interesting to see the ClassLoader gets collected, but not the corresponding PyJavaType. To me this implies the Class was necessarily collected; but it's not observable directly in Python code. While you are busy on other things, I will try playing with this changeset some more to see what is going on here. Maybe it ends just being a simple question of setting up a ref queue on Class GC and calling ClassValue#remove. It's rather awesome about the simplification of fromClass, and removing the separate implementation of fromClassSkippingInners. - Jim On Sun, Sep 17, 2017 at 2:41 AM, Jeff Allen <ja...@fa...> wrote: > Jim: > > I figured out needsInners (I think!) and how I could make fromClass and > fromClassSkippingInners into one method using the state of the registry to > steer the action to be almost the same -- and reach the same conclusion -- > with a net reduction in code. > > https://bitbucket.org/tournesol/jython-fgtype/commits/ > f781dc1f52c9b3733841b375831f8a3c0d27a93e > > I have added a test to prove the PyType (actually PyJavaType) is GC'd when > we cease to reference it, using make_jar_classloader, but it is presently > failing. Applied retrospectively to successive change sets it begins to > fail exactly where I introduce ClassValue. :( > Maybe ClassValue doesn't quite work as I thought. Or I'm still not using > it as John Rose intended. It seems wrong we should have to layer weak > references on top or have some kind of removal queue. > > I tried visualvm to see where it might be referenced, but I'm not sure how > to interpret what it's telling me. However, this week, and maybe longer, > other things have priority. Ideas welcome for when I'm back to this. > For exposed PyObjects, I'm pretty sure classToBuilder always was keeping a > strong reference that would keep them alive now. (But not for the type > under test.) I've removed this effect. But maybe we don't mind that? > https://bitbucket.org/tournesol/jython-fgtype/commits/ > f781dc1f52c9b3733841b375831f8a3c0d27a93e#Lsrc/org/python/ > core/PyType.javaT1208 > > Jeff > > > On 12/09/2017 01:37, Jim Baker wrote: > > [I'm been having some problem posting to the jython-dev mailing list, > let's see if this response gets through!] > > On Mon, Sep 11, 2017 at 1:47 PM, Jeff Allen <ja...@fa...> wrote: > >> Jim: >> >> Thanks for the pointers. I agree with you on #2 that what I've got >> *should* behave correctly with class loaders, but is there a test you can >> suggest (or one I've missed) that conclusively demonstrates it? >> > > So I would start with test_support.make_jar_classloader, just because > it's easier to test this behavior in Python. test_classpathimporter seems > to use this support functionality nicely. > > If we want to add testing of our expectations around ClassValue's > lifetime, we can also add some sort of weakref scheme, in conjunction with > a multi-round GC, to verify that the PyType gets collected as expected. Of > course we should expect ClassValue to behave as expected, but this would > ensure we are not holding anything, now or in the future implementation, in > the Jython runtime that would violate this contract. > > >> I'll press in on the question of inners. I tried just calling fromClass, >> but it fails when the inner extends the outer (test_import_jy:: >> test_selfreferential_classes fails). You have to initialise the outer, then >> visit the inners. In a way, it's the PyJavaType counterpart of the deferred >> initialisation of exposed types that we control by identifying bootstrap >> types. But here it has to be self-guiding. >> >> I have an idea that if I can make fromClass and fromClassSkippingInners >> the same thing, then that can become the implementation >> classToValue.computeValue, and I won't need the NotReady exception or >> findExistingType. >> > > So Java classes can form a general type graph (directed, with cycles). It > seems to me that the NotReady acts as some sort of coloring in the graph > exploration that fromClass is doing. But as I said, I find this code for > inner classes rather subtle! Good luck in your coding here, it would be > really nice to get some further simplification. > > >> >> Jeff >> >> On 10/09/2017 01:12, Jim Baker wrote: >> >>> Thanks for working on this change set, it's really good stuff. In >>> particular, that's a very nice handoff you do in the PyType.Registry class, >>> specifically moving computed types from classToNewType to classToType; and >>> managing the NotReady state. Perhaps it needs some sort of state diagram to >>> illustrate, but as someone who has been in that code, it makes perfect >>> sense. >>> >>> With respect to GC, the following should be the case: >>> >>> * As long as the ClassLoader for the mapped Java class instance C is >>> around, the corresponding PyType instance T will live. This >>> follows from the definition of ClassValue as you point out in the >>> code comments. (Good!) >>> * As long as Python code holds a hard ref to T, the corresponding C >>> will live. (Good!) (So we would see this in from `some_java_pkg >>> import baz`; and it follows from the underlying_class field >>> holding a hard ref from T to C.) >>> * As long as Python code holds a hard ref to an instance of C, the >>> corresponding T will also live. (Good!) >>> >>> Otherwise, this mapping will allow for GC of T, and subsequently of C, >>> per the definition of ClassValue. I was also looking at Groovy's usage of a >>> similar mapping, and corresponding bug, https://bugs.openjdk.java.net/ >>> browse/JDK-8136353, and it looks like the problem reported there >>> doesn't hold. This is because there are no strong refs outside of PyType >>> itself. >>> >>> So everything looks good for getting this change in. >>> >>> On Sat, Sep 9, 2017 at 2:12 PM, Jeff Allen <ja...@fa... <mailto: >>> ja...@fa...>> wrote: >>> >>> Jim, all: >>> >>> By a series of small steps I've come quite a long way in this >>> aspect of PyType. It might be worth a look. >>> https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8 >>> ff48bf5d20cb57169cd3f43a3cd90df0cd >>> <https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d >>> 8ff48bf5d20cb57169cd3f43a3cd90df0cd> >>> >>> In this last commit I've entirely dispensed with any long-term >>> reference to the created PyType in the type registry: only the >>> ClassValue holds one. The explicit management of reachability goes >>> away and we have just the behaviour given us by ClassValue. The >>> only down-side I see is that a PyType created for a Java class you >>> handle briefly from Python will not be collectable until the class >>> is. >>> >>> The old test for weakness, which I've been running in parallel >>> with the new, requires PyType.getClassToType(), and can no longer >>> be supported. (You can't enumerate the ClassValue.) I believe the >>> replacement tests the same thing -- they used to pass and fail >>> together. >>> >>> >>> Right, it makes sense to remove this test. This is because we don't want >>> to support the necessary mapping, even though it could be readily supported >>> with an appropriate concurrent weak mapping - the only semantics it would >>> be supporting is for this very test. >>> >>> >>> I've moved some actions around, and removed some of the checks. We >>> seemingly expected the desired PyType to be created at any moment >>> by a side effect. Reason and regression testing tell me that >>> doesn't happen in the new arrangement. I think there is slightly >>> less code to execute, but masses more comment and debug -- it's my >>> way of figuring it out. It's all very educational. >>> >>> I still don't understand: >>> >>> 1. Whether we find the downside (PyType not GC'd until the class is) >>> important. >>> >>> >>> So we do know that Jython will continue to work if we remove a mapping >>> entry, since it happens all the time currently in some code like json, re, >>> and socket, where classes are not directly imported :) We could always do >>> some sort of LRU and then call ClassValue#remove, but I don't think it >>> makes sense. There are many other other optimizations in the runtime first. >>> >>> 2. Whether I have broken something that the regression tests don't >>> cover (like use with isolating class loaders). >>> >>> >>> These are different Java classes if in different class loaders. For >>> Python usage of these Java classes, it's all the same, thanks to duck >>> typing, but we need to maintain a different mapping entry. Again #1 >>> demonstrates we have been handling this correctly in the current codebase. >>> >>> 3. What needsInners is really up to. I see *what* it does, but not >>> *why* well enough to consider alternatives. It would simplify >>> computeValue if there were no fromClassSkippingInners: could >>> needsInners be a registry global? And why do we skip processing >>> them, when we do? >>> >>> >>> That codepath is exceedingly subtle, at least to me. But it would be an >>> interesting experiment to see if it could be made global, vs this >>> potentially expanding context that is passed through. >>> >>> - Jim >>> >> >> > > |
From: Jeff A. <ja...@fa...> - 2017-09-17 08:41:49
|
Jim: I figured out needsInners (I think!) and how I could make fromClass and fromClassSkippingInners into one method using the state of the registry to steer the action to be almost the same -- and reach the same conclusion -- with a net reduction in code. https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc1f52c9b3733841b375831f8a3c0d27a93e I have added a test to prove the PyType (actually PyJavaType) is GC'd when we cease to reference it, using make_jar_classloader, but it is presently failing. Applied retrospectively to successive change sets it begins to fail exactly where I introduce ClassValue. :( Maybe ClassValue doesn't quite work as I thought. Or I'm still not using it as John Rose intended. It seems wrong we should have to layer weak references on top or have some kind of removal queue. I tried visualvm to see where it might be referenced, but I'm not sure how to interpret what it's telling me. However, this week, and maybe longer, other things have priority. Ideas welcome for when I'm back to this. For exposed PyObjects, I'm pretty sure classToBuilder always was keeping a strong reference that would keep them alive now. (But not for the type under test.) I've removed this effect. But maybe we don't mind that? https://bitbucket.org/tournesol/jython-fgtype/commits/f781dc1f52c9b3733841b375831f8a3c0d27a93e#Lsrc/org/python/core/PyType.javaT1208 Jeff On 12/09/2017 01:37, Jim Baker wrote: > [I'm been having some problem posting to the jython-dev mailing list, > let's see if this response gets through!] > > On Mon, Sep 11, 2017 at 1:47 PM, Jeff Allen <ja...@fa... > <mailto:ja...@fa...>> wrote: > > Jim: > > Thanks for the pointers. I agree with you on #2 that what I've got > *should* behave correctly with class loaders, but is there a test > you can suggest (or one I've missed) that conclusively > demonstrates it? > > > So I would start with test_support.make_jar_classloader, just because > it's easier to test this behavior in Python. test_classpathimporter > seems to use this support functionality nicely. > > If we want to add testing of our expectations around ClassValue's > lifetime, we can also add some sort of weakref scheme, in conjunction > with a multi-round GC, to verify that the PyType gets collected as > expected. Of course we should expect ClassValue to behave as expected, > but this would ensure we are not holding anything, now or in the > future implementation, in the Jython runtime that would violate this > contract. > > > I'll press in on the question of inners. I tried just calling > fromClass, but it fails when the inner extends the outer > (test_import_jy:: test_selfreferential_classes fails). You have to > initialise the outer, then visit the inners. In a way, it's the > PyJavaType counterpart of the deferred initialisation of exposed > types that we control by identifying bootstrap types. But here it > has to be self-guiding. > > I have an idea that if I can make fromClass and > fromClassSkippingInners the same thing, then that can become the > implementation classToValue.computeValue, and I won't need the > NotReady exception or findExistingType. > > > So Java classes can form a general type graph (directed, with cycles). > It seems to me that the NotReady acts as some sort of coloring in the > graph exploration that fromClass is doing. But as I said, I find this > code for inner classes rather subtle! Good luck in your coding here, > it would be really nice to get some further simplification. > > > Jeff > > On 10/09/2017 01:12, Jim Baker wrote: > > Thanks for working on this change set, it's really good stuff. > In particular, that's a very nice handoff you do in the > PyType.Registry class, specifically moving computed types from > classToNewType to classToType; and managing the NotReady > state. Perhaps it needs some sort of state diagram to > illustrate, but as someone who has been in that code, it makes > perfect sense. > > With respect to GC, the following should be the case: > > * As long as the ClassLoader for the mapped Java class > instance C is > around, the corresponding PyType instance T will live. This > follows from the definition of ClassValue as you point out > in the > code comments. (Good!) > * As long as Python code holds a hard ref to T, the > corresponding C > will live. (Good!) (So we would see this in from > `some_java_pkg > import baz`; and it follows from the underlying_class field > holding a hard ref from T to C.) > * As long as Python code holds a hard ref to an instance of > C, the > corresponding T will also live. (Good!) > > Otherwise, this mapping will allow for GC of T, and > subsequently of C, per the definition of ClassValue. I was > also looking at Groovy's usage of a similar mapping, and > corresponding bug, > https://bugs.openjdk.java.net/browse/JDK-8136353 > <https://bugs.openjdk.java.net/browse/JDK-8136353>, and it > looks like the problem reported there doesn't hold. This is > because there are no strong refs outside of PyType itself. > > So everything looks good for getting this change in. > > On Sat, Sep 9, 2017 at 2:12 PM, Jeff Allen <ja...@fa... > <mailto:ja...@fa...> <mailto:ja...@fa... > <mailto:ja...@fa...>>> wrote: > > Jim, all: > > By a series of small steps I've come quite a long way in this > aspect of PyType. It might be worth a look. > https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd > <https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd> > > <https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd > <https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd>> > > In this last commit I've entirely dispensed with any long-term > reference to the created PyType in the type registry: only the > ClassValue holds one. The explicit management of > reachability goes > away and we have just the behaviour given us by > ClassValue. The > only down-side I see is that a PyType created for a Java > class you > handle briefly from Python will not be collectable until > the class is. > > The old test for weakness, which I've been running in parallel > with the new, requires PyType.getClassToType(), and can no > longer > be supported. (You can't enumerate the ClassValue.) I > believe the > replacement tests the same thing -- they used to pass and fail > together. > > > Right, it makes sense to remove this test. This is because we > don't want to support the necessary mapping, even though it > could be readily supported with an appropriate concurrent weak > mapping - the only semantics it would be supporting is for > this very test. > > > I've moved some actions around, and removed some of the > checks. We > seemingly expected the desired PyType to be created at any > moment > by a side effect. Reason and regression testing tell me that > doesn't happen in the new arrangement. I think there is > slightly > less code to execute, but masses more comment and debug -- > it's my > way of figuring it out. It's all very educational. > > I still don't understand: > > 1. Whether we find the downside (PyType not GC'd until the > class is) > important. > > > So we do know that Jython will continue to work if we remove a > mapping entry, since it happens all the time currently in some > code like json, re, and socket, where classes are not directly > imported :) We could always do some sort of LRU and then call > ClassValue#remove, but I don't think it makes sense. There are > many other other optimizations in the runtime first. > > 2. Whether I have broken something that the regression > tests don't > cover (like use with isolating class loaders). > > > These are different Java classes if in different class > loaders. For Python usage of these Java classes, it's all the > same, thanks to duck typing, but we need to maintain a > different mapping entry. Again #1 demonstrates we have been > handling this correctly in the current codebase. > > 3. What needsInners is really up to. I see *what* it does, > but not > *why* well enough to consider alternatives. It would > simplify > computeValue if there were no fromClassSkippingInners: > could > needsInners be a registry global? And why do we skip > processing > them, when we do? > > > That codepath is exceedingly subtle, at least to me. But it > would be an interesting experiment to see if it could be made > global, vs this potentially expanding context that is passed > through. > > - Jim > > > |
From: Jython t. <st...@bu...> - 2017-09-15 16:10:23
|
ACTIVITY SUMMARY (2017-09-08 - 2017-09-15) Jython tracker at http://bugs.jython.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open 317 ( +1) closed 2327 ( +0) total 2644 ( +1) Open issues with patches: 28 Issues opened (1) ================= #2625: Repeated calls to the socket module crashes during execution http://bugs.jython.org/issue2625 opened by paraita Most recent 15 issues with no replies (15) ========================================== #2625: Repeated calls to the socket module crashes during execution http://bugs.jython.org/issue2625 #2618: socket.sendall no longer sends all http://bugs.jython.org/issue2618 #2616: Incomplete / broken support for Certificate Revocation Lists http://bugs.jython.org/issue2616 #2613: 2.7.1 MANIFEST.MF contains unfilled placeholders http://bugs.jython.org/issue2613 #2611: mkdir() operation in /Lib/os.py has different behavior when ru http://bugs.jython.org/issue2611 #2606: jython launch problem sun.misc.InvalidJarIndexException http://bugs.jython.org/issue2606 #2605: Jython 2.7.0 startup performance regression http://bugs.jython.org/issue2605 #2591: Unable to execute directory or zip file (test_cmd_line_script) http://bugs.jython.org/issue2591 #2567: System state lost during JSR-223 initialisation http://bugs.jython.org/issue2567 #2562: Windows: OSError: unlink(): an unknown error occurred http://bugs.jython.org/issue2562 #2531: Support SNI for SSL/TLS server sockets http://bugs.jython.org/issue2531 #2525: Jython incorrectly buffers file pipe output with Subprocess(co http://bugs.jython.org/issue2525 #2520: Jython does NOT support socket.listen(0) for accepting only on http://bugs.jython.org/issue2520 #2512: Values in built-in modules's __dict__ are â<reflected field http://bugs.jython.org/issue2512 #2507: Run "invokeFunction" in a thread does not inherit the "ScriptC http://bugs.jython.org/issue2507 Most recent 15 issues waiting for review (15) ============================================= #2566: inspect does not recognize code objects from bytecode files http://bugs.jython.org/issue2566 #2545: help() does not work on Java-implemented modules http://bugs.jython.org/issue2545 #2429: cStringIO does not work with mutable objects implementing the http://bugs.jython.org/issue2429 #2367: Jython ignores custom __eq__ when hashing dict subclasses http://bugs.jython.org/issue2367 #2330: full-build fails to copy CPython License http://bugs.jython.org/issue2330 #2230: Jython evaluation blocks under heavy load with high multi-core http://bugs.jython.org/issue2230 #2143: site-packages support in standalone jar http://bugs.jython.org/issue2143 #2142: Set Thread classloader when entering Jython context http://bugs.jython.org/issue2142 #2121: Jython jar on Maven central embeds other third party libraries http://bugs.jython.org/issue2121 #2077: marshal doesn't raise error when fed unmarshalable object http://bugs.jython.org/issue2077 #1925: Support loading java.sql.Drivers that aren't on the boot class http://bugs.jython.org/issue1925 #1917: No ctypes.c_char http://bugs.jython.org/issue1917 #1866: Parser does not have mismatch token error messages caught by B http://bugs.jython.org/issue1866 #1842: Add IBM i support to Jython http://bugs.jython.org/issue1842 #1796: Jython doesn't support jar dir with colon's in it http://bugs.jython.org/issue1796 Top 10 most discussed issues (3) ================================ #2445: Eclipse's DelegatingFeatureMap has MRO conflict http://bugs.jython.org/issue2445 4 msgs #2505: PySystemState is lost http://bugs.jython.org/issue2505 3 msgs #2622: json dumps error http://bugs.jython.org/issue2622 3 msgs |
From: Jim B. <jim...@py...> - 2017-09-12 00:46:07
|
Trying one more time to post to jython-dev... On Mon, Sep 11, 2017 at 6:37 PM, Jim Baker <jim...@py...> wrote: > [I'm been having some problem posting to the jython-dev mailing list, > let's see if this response gets through!] > > On Mon, Sep 11, 2017 at 1:47 PM, Jeff Allen <ja...@fa...> wrote: > >> Jim: >> >> Thanks for the pointers. I agree with you on #2 that what I've got >> *should* behave correctly with class loaders, but is there a test you can >> suggest (or one I've missed) that conclusively demonstrates it? >> > > So I would start with test_support.make_jar_classloader, just because > it's easier to test this behavior in Python. test_classpathimporter seems > to use this support functionality nicely. > > If we want to add testing of our expectations around ClassValue's > lifetime, we can also add some sort of weakref scheme, in conjunction with > a multi-round GC, to verify that the PyType gets collected as expected. Of > course we should expect ClassValue to behave as expected, but this would > ensure we are not holding anything, now or in the future implementation, in > the Jython runtime that would violate this contract. > > >> I'll press in on the question of inners. I tried just calling fromClass, >> but it fails when the inner extends the outer (test_import_jy:: >> test_selfreferential_classes fails). You have to initialise the outer, then >> visit the inners. In a way, it's the PyJavaType counterpart of the deferred >> initialisation of exposed types that we control by identifying bootstrap >> types. But here it has to be self-guiding. >> >> I have an idea that if I can make fromClass and fromClassSkippingInners >> the same thing, then that can become the implementation >> classToValue.computeValue, and I won't need the NotReady exception or >> findExistingType. >> > > So Java classes can form a general type graph (directed, with cycles). It > seems to me that the NotReady acts as some sort of coloring in the graph > exploration that fromClass is doing. But as I said, I find this code for > inner classes rather subtle! Good luck in your coding here, it would be > really nice to get some further simplification. > > >> >> Jeff >> >> On 10/09/2017 01:12, Jim Baker wrote: >> >>> Thanks for working on this change set, it's really good stuff. In >>> particular, that's a very nice handoff you do in the PyType.Registry class, >>> specifically moving computed types from classToNewType to classToType; and >>> managing the NotReady state. Perhaps it needs some sort of state diagram to >>> illustrate, but as someone who has been in that code, it makes perfect >>> sense. >>> >>> With respect to GC, the following should be the case: >>> >>> * As long as the ClassLoader for the mapped Java class instance C is >>> around, the corresponding PyType instance T will live. This >>> follows from the definition of ClassValue as you point out in the >>> code comments. (Good!) >>> * As long as Python code holds a hard ref to T, the corresponding C >>> will live. (Good!) (So we would see this in from `some_java_pkg >>> import baz`; and it follows from the underlying_class field >>> holding a hard ref from T to C.) >>> * As long as Python code holds a hard ref to an instance of C, the >>> corresponding T will also live. (Good!) >>> >>> Otherwise, this mapping will allow for GC of T, and subsequently of C, >>> per the definition of ClassValue. I was also looking at Groovy's usage of a >>> similar mapping, and corresponding bug, https://bugs.openjdk.java.net/ >>> browse/JDK-8136353, and it looks like the problem reported there >>> doesn't hold. This is because there are no strong refs outside of PyType >>> itself. >>> >>> So everything looks good for getting this change in. >>> >>> On Sat, Sep 9, 2017 at 2:12 PM, Jeff Allen <ja...@fa... <mailto: >>> ja...@fa...>> wrote: >>> >>> Jim, all: >>> >>> By a series of small steps I've come quite a long way in this >>> aspect of PyType. It might be worth a look. >>> https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8 >>> ff48bf5d20cb57169cd3f43a3cd90df0cd >>> <https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d >>> 8ff48bf5d20cb57169cd3f43a3cd90df0cd> >>> >>> In this last commit I've entirely dispensed with any long-term >>> reference to the created PyType in the type registry: only the >>> ClassValue holds one. The explicit management of reachability goes >>> away and we have just the behaviour given us by ClassValue. The >>> only down-side I see is that a PyType created for a Java class you >>> handle briefly from Python will not be collectable until the class >>> is. >>> >>> The old test for weakness, which I've been running in parallel >>> with the new, requires PyType.getClassToType(), and can no longer >>> be supported. (You can't enumerate the ClassValue.) I believe the >>> replacement tests the same thing -- they used to pass and fail >>> together. >>> >>> >>> Right, it makes sense to remove this test. This is because we don't want >>> to support the necessary mapping, even though it could be readily supported >>> with an appropriate concurrent weak mapping - the only semantics it would >>> be supporting is for this very test. >>> >>> >>> I've moved some actions around, and removed some of the checks. We >>> seemingly expected the desired PyType to be created at any moment >>> by a side effect. Reason and regression testing tell me that >>> doesn't happen in the new arrangement. I think there is slightly >>> less code to execute, but masses more comment and debug -- it's my >>> way of figuring it out. It's all very educational. >>> >>> I still don't understand: >>> >>> 1. Whether we find the downside (PyType not GC'd until the class is) >>> important. >>> >>> >>> So we do know that Jython will continue to work if we remove a mapping >>> entry, since it happens all the time currently in some code like json, re, >>> and socket, where classes are not directly imported :) We could always do >>> some sort of LRU and then call ClassValue#remove, but I don't think it >>> makes sense. There are many other other optimizations in the runtime first. >>> >>> 2. Whether I have broken something that the regression tests don't >>> cover (like use with isolating class loaders). >>> >>> >>> These are different Java classes if in different class loaders. For >>> Python usage of these Java classes, it's all the same, thanks to duck >>> typing, but we need to maintain a different mapping entry. Again #1 >>> demonstrates we have been handling this correctly in the current codebase. >>> >>> 3. What needsInners is really up to. I see *what* it does, but not >>> *why* well enough to consider alternatives. It would simplify >>> computeValue if there were no fromClassSkippingInners: could >>> needsInners be a registry global? And why do we skip processing >>> them, when we do? >>> >>> >>> That codepath is exceedingly subtle, at least to me. But it would be an >>> interesting experiment to see if it could be made global, vs this >>> potentially expanding context that is passed through. >>> >>> - Jim >>> >> >> > |
From: Jeff A. <ja...@fa...> - 2017-09-11 19:48:02
|
Jim: Thanks for the pointers. I agree with you on #2 that what I've got *should* behave correctly with class loaders, but is there a test you can suggest (or one I've missed) that conclusively demonstrates it? I'll press in on the question of inners. I tried just calling fromClass, but it fails when the inner extends the outer (test_import_jy:: test_selfreferential_classes fails). You have to initialise the outer, then visit the inners. In a way, it's the PyJavaType counterpart of the deferred initialisation of exposed types that we control by identifying bootstrap types. But here it has to be self-guiding. I have an idea that if I can make fromClass and fromClassSkippingInners the same thing, then that can become the implementation classToValue.computeValue, and I won't need the NotReady exception or findExistingType. Jeff On 10/09/2017 01:12, Jim Baker wrote: > Thanks for working on this change set, it's really good stuff. In > particular, that's a very nice handoff you do in the PyType.Registry > class, specifically moving computed types from classToNewType to > classToType; and managing the NotReady state. Perhaps it needs some > sort of state diagram to illustrate, but as someone who has been in > that code, it makes perfect sense. > > With respect to GC, the following should be the case: > > * As long as the ClassLoader for the mapped Java class instance C is > around, the corresponding PyType instance T will live. This > follows from the definition of ClassValue as you point out in the > code comments. (Good!) > * As long as Python code holds a hard ref to T, the corresponding C > will live. (Good!) (So we would see this in from `some_java_pkg > import baz`; and it follows from the underlying_class field > holding a hard ref from T to C.) > * As long as Python code holds a hard ref to an instance of C, the > corresponding T will also live. (Good!) > > Otherwise, this mapping will allow for GC of T, and subsequently of C, > per the definition of ClassValue. I was also looking at Groovy's usage > of a similar mapping, and corresponding bug, > https://bugs.openjdk.java.net/browse/JDK-8136353, and it looks like > the problem reported there doesn't hold. This is because there are no > strong refs outside of PyType itself. > > So everything looks good for getting this change in. > > On Sat, Sep 9, 2017 at 2:12 PM, Jeff Allen <ja...@fa... > <mailto:ja...@fa...>> wrote: > > Jim, all: > > By a series of small steps I've come quite a long way in this > aspect of PyType. It might be worth a look. > https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd > <https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd> > > In this last commit I've entirely dispensed with any long-term > reference to the created PyType in the type registry: only the > ClassValue holds one. The explicit management of reachability goes > away and we have just the behaviour given us by ClassValue. The > only down-side I see is that a PyType created for a Java class you > handle briefly from Python will not be collectable until the class is. > > The old test for weakness, which I've been running in parallel > with the new, requires PyType.getClassToType(), and can no longer > be supported. (You can't enumerate the ClassValue.) I believe the > replacement tests the same thing -- they used to pass and fail > together. > > > Right, it makes sense to remove this test. This is because we don't > want to support the necessary mapping, even though it could be readily > supported with an appropriate concurrent weak mapping - the only > semantics it would be supporting is for this very test. > > > I've moved some actions around, and removed some of the checks. We > seemingly expected the desired PyType to be created at any moment > by a side effect. Reason and regression testing tell me that > doesn't happen in the new arrangement. I think there is slightly > less code to execute, but masses more comment and debug -- it's my > way of figuring it out. It's all very educational. > > I still don't understand: > > 1. Whether we find the downside (PyType not GC'd until the class is) > important. > > > So we do know that Jython will continue to work if we remove a mapping > entry, since it happens all the time currently in some code like json, > re, and socket, where classes are not directly imported :) We could > always do some sort of LRU and then call ClassValue#remove, but I > don't think it makes sense. There are many other other optimizations > in the runtime first. > > 2. Whether I have broken something that the regression tests don't > cover (like use with isolating class loaders). > > > These are different Java classes if in different class loaders. For > Python usage of these Java classes, it's all the same, thanks to duck > typing, but we need to maintain a different mapping entry. Again #1 > demonstrates we have been handling this correctly in the current codebase. > > 3. What needsInners is really up to. I see *what* it does, but not > *why* well enough to consider alternatives. It would simplify > computeValue if there were no fromClassSkippingInners: could > needsInners be a registry global? And why do we skip processing > them, when we do? > > > That codepath is exceedingly subtle, at least to me. But it would be > an interesting experiment to see if it could be made global, vs this > potentially expanding context that is passed through. > > - Jim |
From: Jeff A. <ja...@fa...> - 2017-09-09 20:13:01
|
Jim, all: By a series of small steps I've come quite a long way in this aspect of PyType. It might be worth a look. https://bitbucket.org/tournesol/jython-fgtype/commits/3fc5d8ff48bf5d20cb57169cd3f43a3cd90df0cd In this last commit I've entirely dispensed with any long-term reference to the created PyType in the type registry: only the ClassValue holds one. The explicit management of reachability goes away and we have just the behaviour given us by ClassValue. The only down-side I see is that a PyType created for a Java class you handle briefly from Python will not be collectable until the class is. The old test for weakness, which I've been running in parallel with the new, requires PyType.getClassToType(), and can no longer be supported. (You can't enumerate the ClassValue.) I believe the replacement tests the same thing -- they used to pass and fail together. I've moved some actions around, and removed some of the checks. We seemingly expected the desired PyType to be created at any moment by a side effect. Reason and regression testing tell me that doesn't happen in the new arrangement. I think there is slightly less code to execute, but masses more comment and debug -- it's my way of figuring it out. It's all very educational. I still don't understand: 1. Whether we find the downside (PyType not GC'd until the class is) important. 2. Whether I have broken something that the regression tests don't cover (like use with isolating class loaders). 3. What needsInners is really up to. I see *what* it does, but not *why* well enough to consider alternatives. It would simplify computeValue if there were no fromClassSkippingInners: could needsInners be a registry global? And why do we skip processing them, when we do? Jeff On 09/08/2017 08:24, Jeff Allen wrote: > Jim, all: > > Apologies for the near repeat, but my first attempt to give this a > life of its own on Jython-dev ended up nested under issue 2487 again. > Hope this lands as a fresh topic. > > On 05/08/2017 20:34, in Issue #2387 > (http://bugs.jython.org/issue2487), Jim Baker wrote: >> >> What if instead of current one-level cache, we had a two-level cache? >> Level 1 uses weak key/weak value for the class/type entries (C, T); >> (C, T) entries that are expired from Level 1 are moved to Level 2; >> Level 2 uses an expiration time so a ClassLoader could be unloaded in >> say some reasonable amount of time. >> ... >> >> Lastly, >> https://docs.oracle.com/javase/7/docs/api/java/lang/ClassValue.html >> looks potentially useful as an alternative for publishing PyType >> objects into a cache. But we need to address two key questions: >> >> 1. Whether ClassValue#computeValue would work properly in the >> re-entrant case where the class graph from a given class C is >> explored, as is done for inners, possibly referring back to C. This >> is why we could not get the publication of the type in the map done >> after the init (as one would usually want to do!) in >> https://github.com/jythontools/jython/blob/master/src/org/python/core/PyType.java#L1515 >> >> (putIfAbsent); class C would be referenced, and it would attempt to >> build again (and stack overflow). No solution I tried could break >> this problem. >> >> 2. When to call ClassValue#removeValue ! We still have to keep track >> of the cache with respect to PyType. > > I have an idea that I can use ClassValue with this, but it sits as a > (lock-free) cache in front of the same (properly locked) apparatus we > have now. > ... > Thing is, I don't understand in what circumstances we ought to create > the strong reference: what need are we actually seeking to meet? Is > the critical use case that the PyType could be freed when Python code > stops using it, and yet the Java class has reason to remain? |
From: Jython t. <st...@bu...> - 2017-09-08 16:10:23
|
ACTIVITY SUMMARY (2017-09-01 - 2017-09-08) Jython tracker at http://bugs.jython.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open 316 ( -5) closed 2327 ( +7) total 2643 ( +2) Open issues with patches: 28 Issues opened (2) ================= #2623: jython (Linux) does not respect my EOF char http://bugs.jython.org/issue2623 opened by zsd #2624: Deadlock with jython script engine initialization and jython o http://bugs.jython.org/issue2624 opened by fviale Most recent 15 issues with no replies (15) ========================================== #2618: socket.sendall no longer sends all http://bugs.jython.org/issue2618 #2616: Incomplete / broken support for Certificate Revocation Lists http://bugs.jython.org/issue2616 #2613: 2.7.1 MANIFEST.MF contains unfilled placeholders http://bugs.jython.org/issue2613 #2611: mkdir() operation in /Lib/os.py has different behavior when ru http://bugs.jython.org/issue2611 #2606: jython launch problem sun.misc.InvalidJarIndexException http://bugs.jython.org/issue2606 #2605: Jython 2.7.0 startup performance regression http://bugs.jython.org/issue2605 #2591: Unable to execute directory or zip file (test_cmd_line_script) http://bugs.jython.org/issue2591 #2567: System state lost during JSR-223 initialisation http://bugs.jython.org/issue2567 #2562: Windows: OSError: unlink(): an unknown error occurred http://bugs.jython.org/issue2562 #2531: Support SNI for SSL/TLS server sockets http://bugs.jython.org/issue2531 #2525: Jython incorrectly buffers file pipe output with Subprocess(co http://bugs.jython.org/issue2525 #2520: Jython does NOT support socket.listen(0) for accepting only on http://bugs.jython.org/issue2520 #2512: Values in built-in modules's __dict__ are â<reflected field http://bugs.jython.org/issue2512 #2507: Run "invokeFunction" in a thread does not inherit the "ScriptC http://bugs.jython.org/issue2507 #2494: Support for pydoc_data http://bugs.jython.org/issue2494 Most recent 15 issues waiting for review (15) ============================================= #2566: inspect does not recognize code objects from bytecode files http://bugs.jython.org/issue2566 #2545: help() does not work on Java-implemented modules http://bugs.jython.org/issue2545 #2429: cStringIO does not work with mutable objects implementing the http://bugs.jython.org/issue2429 #2367: Jython ignores custom __eq__ when hashing dict subclasses http://bugs.jython.org/issue2367 #2330: full-build fails to copy CPython License http://bugs.jython.org/issue2330 #2230: Jython evaluation blocks under heavy load with high multi-core http://bugs.jython.org/issue2230 #2143: site-packages support in standalone jar http://bugs.jython.org/issue2143 #2142: Set Thread classloader when entering Jython context http://bugs.jython.org/issue2142 #2121: Jython jar on Maven central embeds other third party libraries http://bugs.jython.org/issue2121 #2077: marshal doesn't raise error when fed unmarshalable object http://bugs.jython.org/issue2077 #1925: Support loading java.sql.Drivers that aren't on the boot class http://bugs.jython.org/issue1925 #1917: No ctypes.c_char http://bugs.jython.org/issue1917 #1866: Parser does not have mismatch token error messages caught by B http://bugs.jython.org/issue1866 #1842: Add IBM i support to Jython http://bugs.jython.org/issue1842 #1796: Jython doesn't support jar dir with colon's in it http://bugs.jython.org/issue1796 Top 10 most discussed issues (3) ================================ #2622: json dumps error http://bugs.jython.org/issue2622 5 msgs #2623: jython (Linux) does not respect my EOF char http://bugs.jython.org/issue2623 5 msgs #2624: Deadlock with jython script engine initialization and jython o http://bugs.jython.org/issue2624 3 msgs |
From: Rory O'D. <ror...@or...> - 2017-09-07 09:25:01
|
Hi Alan, Oracle is proposing a rapid release model for Java SE going-forward. The high points are highlighted below, details of the changes can be found on Mark Reinhold’s blog [1] , OpenJDK discussion email list [2]. Under the proposed release model, after JDK 9, we will adopt a strict, time-based model with a new major release every six months, update releases every quarter, and a long-term support release every three years. The new JDK Project will run a bit differently than the past "JDK $N" Projects: - The main development line will always be open but fixes, enhancements, and features will be merged only when they're nearly finished. The main line will be Feature Complete [3] at all times. - We'll continue to use the JEP Process [4] for new features and other significant changes. The bar to target a JEP to a specific release will, however, be higher since the work must be Feature Complete in order to go in. Owners of large or risky features will be strongly encouraged to split such features up into smaller and safer parts, to integrate earlier in the release cycle, and to publish separate lines of early-access builds prior to integration. The JDK Updates Project will run in much the same way as the past "JDK $N" Updates Projects, though update releases will be strictly limited to fixes of security issues, regressions, and bugs in newer features. Related to this proposal, we intend to make a few changes in what we do: - Starting with JDK 9 we'll ship OpenJDK builds under the GPL [5], to make it easier for developers to deploy Java applications to cloud environments. We'll initially publish OpenJDK builds for Linux/x64, followed later by builds for macOS/x64 and Windows/x64. - We'll continue to ship proprietary "Oracle JDK" builds, which include "commercial features" [6] such as Java Flight Recorder and Mission Control [7], under a click-through binary-code license [8]. Oracle will continue to offer paid support for these builds. - After JDK 9 we'll open-source the commercial features in order to make the OpenJDK builds more attractive to developers and to reduce the differences between those builds and the Oracle JDK. This will take some time, but the ultimate goal is to make OpenJDK and Oracle JDK builds completely interchangeable. - Finally, for the long term we'll work with other OpenJDK contributors to establish an open build-and-test infrastructure. This will make it easier to publish early-access builds for features in development, and eventually make it possible for the OpenJDK Community itself to publish authoritative builds of the JDK. Questions , comments, feedback to OpenJDK discuss mailing list [2] Rgds,Rory [1]https://mreinhold.org/blog/forward-faster [2]http://mail.openjdk.java.net/pipermail/discuss/2017-September/004281.html [3]http://openjdk.java.net/projects/jdk8/milestones#Feature_Complete [4]http://openjdk.java.net/jeps/0 [5]http://openjdk.java.net/legal/gplv2+ce.html [6]http://www.oracle.com/technetwork/java/javase/terms/products/index.html [7]http://www.oracle.com/technetwork/java/javaseproducts/mission-control/index.html [8]http://www.oracle.com/technetwork/java/javase/terms/license/index.html |
From: Jython t. <st...@bu...> - 2017-09-01 16:10:23
|
ACTIVITY SUMMARY (2017-08-25 - 2017-09-01) Jython tracker at http://bugs.jython.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open 321 ( +2) closed 2320 ( +2) total 2641 ( +4) Open issues with patches: 28 Issues opened (3) ================= #2620: jython-Installer 2.7.1 error code 14001 http://bugs.jython.org/issue2620 opened by airshiplay #2621: jython-Installer 2.7.0 setup.py install error http://bugs.jython.org/issue2621 opened by airshiplay #2622: json dumps error http://bugs.jython.org/issue2622 opened by birkoff Most recent 15 issues with no replies (15) ========================================== #2621: jython-Installer 2.7.0 setup.py install error http://bugs.jython.org/issue2621 #2620: jython-Installer 2.7.1 error code 14001 http://bugs.jython.org/issue2620 #2618: socket.sendall no longer sends all http://bugs.jython.org/issue2618 #2616: Incomplete / broken support for Certificate Revocation Lists http://bugs.jython.org/issue2616 #2615: select.select using subprocess.Popen error http://bugs.jython.org/issue2615 #2613: 2.7.1 MANIFEST.MF contains unfilled placeholders http://bugs.jython.org/issue2613 #2611: mkdir() operation in /Lib/os.py has different behavior when ru http://bugs.jython.org/issue2611 #2606: jython launch problem sun.misc.InvalidJarIndexException http://bugs.jython.org/issue2606 #2605: Jython 2.7.0 startup performance regression http://bugs.jython.org/issue2605 #2591: Unable to execute directory or zip file (test_cmd_line_script) http://bugs.jython.org/issue2591 #2567: System state lost during JSR-223 initialisation http://bugs.jython.org/issue2567 #2562: Windows: OSError: unlink(): an unknown error occurred http://bugs.jython.org/issue2562 #2531: Support SNI for SSL/TLS server sockets http://bugs.jython.org/issue2531 #2525: Jython incorrectly buffers file pipe output with Subprocess(co http://bugs.jython.org/issue2525 #2520: Jython does NOT support socket.listen(0) for accepting only on http://bugs.jython.org/issue2520 Most recent 15 issues waiting for review (15) ============================================= #2566: inspect does not recognize code objects from bytecode files http://bugs.jython.org/issue2566 #2545: help() does not work on Java-implemented modules http://bugs.jython.org/issue2545 #2429: cStringIO does not work with mutable objects implementing the http://bugs.jython.org/issue2429 #2367: Jython ignores custom __eq__ when hashing dict subclasses http://bugs.jython.org/issue2367 #2330: full-build fails to copy CPython License http://bugs.jython.org/issue2330 #2230: Jython evaluation blocks under heavy load with high multi-core http://bugs.jython.org/issue2230 #2143: site-packages support in standalone jar http://bugs.jython.org/issue2143 #2142: Set Thread classloader when entering Jython context http://bugs.jython.org/issue2142 #2121: Jython jar on Maven central embeds other third party libraries http://bugs.jython.org/issue2121 #2077: marshal doesn't raise error when fed unmarshalable object http://bugs.jython.org/issue2077 #1925: Support loading java.sql.Drivers that aren't on the boot class http://bugs.jython.org/issue1925 #1917: No ctypes.c_char http://bugs.jython.org/issue1917 #1866: Parser does not have mismatch token error messages caught by B http://bugs.jython.org/issue1866 #1842: Add IBM i support to Jython http://bugs.jython.org/issue1842 #1796: Jython doesn't support jar dir with colon's in it http://bugs.jython.org/issue1796 Top 10 most discussed issues (1) ================================ #2610: Unexpected program error: ImportError: Cannot import site modu http://bugs.jython.org/issue2610 3 msgs Issues closed (2) ================= #2612: NPE while trying to load class http://bugs.jython.org/issue2612 closed by jeff.allen #2619: professional FPC supplier in China http://bugs.jython.org/issue2619 closed by stefan.richthofer |