From nextgens at freenetproject.org Tue Apr 1 03:09:33 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Tue, 1 Apr 2008 05:09:33 +0200 Subject: [freenet-dev] [freenet-cvs] r18864 - in trunk/apps/new_installer: . res/unix/bin In-Reply-To: <200803312148.40521.toad@amphibian.dyndns.org> References: <20080331114058.F0998479810@freenetproject.org> <200803312148.40521.toad@amphibian.dyndns.org> Message-ID: <20080401030932.GC3485@freenetproject.org> * Matthew Toseland [2008-03-31 21:48:18]: > Does the new mac startup script work? > Dunno, I can't test it... but previous version didn't work anyway :) > On Monday 31 March 2008 12:40, nextgens at freenetproject.org wrote: > > Author: nextgens > > Date: 2008-03-31 11:40:58 +0000 (Mon, 31 Mar 2008) > > New Revision: 18864 > > > > Modified: > > trunk/apps/new_installer/install.xml > > trunk/apps/new_installer/res/unix/bin/install_startup_hook-mac.sh > > Log: > > new_installer: tag the installer with the -rc1 flag > > > > Modified: trunk/apps/new_installer/install.xml > > =================================================================== > > --- trunk/apps/new_installer/install.xml 2008-03-30 15:37:07 UTC (rev 18863) > > +++ trunk/apps/new_installer/install.xml 2008-03-31 11:40:58 UTC (rev 18864) > > @@ -65,7 +65,7 @@ > > > > > > > > - > > + > > > > > > > > > > Modified: trunk/apps/new_installer/res/unix/bin/install_startup_hook-mac.sh > > =================================================================== > > --- trunk/apps/new_installer/res/unix/bin/install_startup_hook-mac.sh > 2008-03-30 15:37:07 UTC (rev 18863) > > +++ trunk/apps/new_installer/res/unix/bin/install_startup_hook-mac.sh > 2008-03-31 11:40:58 UTC (rev 18864) > > @@ -1,6 +1,14 @@ > > #!/bin/sh > > +# This script create a startup script for Freenet under Mac OS X > > +# 2 behaviour: > > +# -pre 10.4.x: use /Library/StartupItems/ > > +# -post 10.4.x: use launchd > > +# > > +# You can send insult at nico%at%thenico%dot%fr%dot%eu%dot%org > > > > -STARTUP_PATH="/Library/StartupItems/" > > +function old_macosx () { > > + > > +STARTUP_PATH="" > > SCRIPT="$STARTUP_PATH/Freenet/Freenet.sh" > > SCRIPT_PLIST="$STARTUP_PATH/Freenet/Freenet.plist" > > > > @@ -11,10 +19,10 @@ > > > > if test ! -d $STARTUP_PATH > > then > > - mkdir $STARTUP_PATH >/dev/null 2>&1 > > + mkdir $STARTUP_PATH 2>&1 >/dev/null > > fi > > > > -mkdir $STARTUP_PATH/Freenet >/dev/null 2>&1 > > +mkdir $STARTUP_PATH/Freenet 2>&1 >/dev/null > > rm -f $SCRIPT > > echo "#!/bin/sh" >> $SCRIPT > > echo ". /etc/rc.common" >> $SCRIPT > > @@ -33,3 +41,84 @@ > > echo "Requires = (\"NetInfo\");" >> $SCRIPT_PLIST > > echo "OrderPreference = \"last\";" >> $SCRIPT_PLIST > > echo '}' >> $SCRIPT_PLIST > > +} > > + > > +function new_macosx () { > > +INSTALL_PATH="${INSTALL_PATH:-$PWD}" > > +STARTUP_FILE="/Library/LaunchDaemons/org.freenetproject.freenet.plist" > > + > > +cd "$INSTALL_PATH" > > + > > +echo "Creating a startup script for Freenet" > > + > > +if test ! -d $STARTUP_PATH > > +then > > + mkdir $STARTUP_PATH 2>&1 >/dev/null > > +fi > > + > > +# No race condition, please :) > > +touch "$STARTUP_FILE" 2>&1 >/dev/null > > +chmod 755 $STARTUP_FILE 2>&1 >/dev/null > > + > > +touch "$STARTUP_FILE".tmp 2>&1 >/dev/null > > +chmod 755 $STARTUP_FILE.tmp 2>&1 >/dev/null > > + > > +cat >> "$STARTUP_FILE" << 'BUG_SCRIPT' > > + > > + > + "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> > > + > > + > > + Disabled > > + > > + Label > > + org.freenetproject.freenet > > + Program > > + REPLACE_WITH_PATH/bin/wrapper-macosx-universal-32 > > + ProgramArguments > > + > > + REPLACE_WITH_PATH/bin/wrapper-macosx-universal-32 > > + -c > > + REPLACE_WITH_PATH/wrapper.conf > > + wrapper.syslog.ident=Freenet > > + wrapper.pidfile=REPLACE_WITH_PATH/Freenet.pid > > + wrapper.daemonize=TRUE > > + wrapper.ignore_signals=REPLACE_WITH_PATH/Freenet.anchor > > + wrapper.ignore_signals=TRUE > > + wrapper.lockfile=REPLACE_WITH_PATH/Freenet > > + > > + WorkingDirectory > > + REPLACE_WITH_PATH > > + UserName > > + REPLACE_WITH_USER > > + ServiceDescription > > + Freenet is a censorhip-resistent darknet. > > + RunAtLoad > > + > > + OnDemand > > + > > + StandardErrorPath > > + /tmp/freenet-start > > + > > + > > +BUG_SCRIPT > > + > > +# GRUIK CODE !! > > +sed "s/REPLACE_WITH_PATH/$INSTALL_PATH/" "$STARTUP_FILE" | > sed "s/REPLACE_WITH_USER/$USER/" "$STARTUP_FILE" > "$STARTUP_FILE".tmp > > +mv "$STARTUP_FILE".tmp "$STARTUP_FILE" 2>&1 >/dev/null > > +chmod 755 $STARTUP_FILE 2>&1 >/dev/null > > + > > + > > + > > +launchctl load $STARTUP_FILE 2>&1 >/dev/null > > + > > +} > > + > > +if [ -x /etc/launchd.conf] > > +then > > +new_macosx > > +else > > +old_macosx > > +fi > > + > > +exit 0 > > > > > _______________________________________________ > Devl mailing list > Devl at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080401/9ab5e03c/attachment.pgp From toad at amphibian.dyndns.org Tue Apr 1 19:07:51 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Tue, 1 Apr 2008 20:07:51 +0100 Subject: [freenet-dev] Freenet 0.7 build 1131 Message-ID: <200804012008.00039.toad@amphibian.dyndns.org> Freenet 0.7 build 1131 is now available, please upgrade. Major changes: - Stop sending the old-format (very large) SSK messages. Other minor changes aimed at avoiding sending huge packets (which frequently cause connectivity problems, excessive resends etc). - Improvements to the stats that drive request the bandwidth liability limiting code. - Add FMS and Publish! to the default bookmarks. - Minor fixes. Release candidate 1 went well, and earned us a slashdot, which the network seems to have survived well, although the same can't be said for our web server! We will try to release another RC on Monday. Please report any bugs you find either to the bug tracker at https://bugs.freenetproject.org/ (if necessary using Tor), or the few remaining working Frost boards, etc, so that we can fix as many bugs as possible before the final 0.7.0. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080401/c317ad9d/attachment.pgp From m.rogers at cs.ucl.ac.uk Wed Apr 2 22:49:04 2008 From: m.rogers at cs.ucl.ac.uk (Michael Rogers) Date: Wed, 02 Apr 2008 23:49:04 +0100 Subject: [freenet-dev] Firefox 3 will default to 15 connections per server Message-ID: <47F40D60.7010902@cs.ucl.ac.uk> http://gemal.dk/blog/2008/03/18/firefox_3_beta_5_will_have_improved_connection_parallelism/ From j16sdiz+freenet at gmail.com Thu Apr 3 01:25:18 2008 From: j16sdiz+freenet at gmail.com (Daniel Cheng) Date: Thu, 3 Apr 2008 09:25:18 +0800 Subject: [freenet-dev] Looking for janitor works / small tasks in freenet Message-ID: Dear list, I am new on this list and wants to contrib to the freenet community and wants to understand freenet archiecture. I am proficient in both C and Java, and did have some (basic) idea on how P2P network (mainly Chord and ed2k) works, some experience in debugging thread synchronization problem. I think I can contribute around 5 hours a week, so I am here looking for some *small* and *self-contained* tasks that I can do. .... Here is a list of tasks I think I can handle (and interested): (1) rework the dbd-index storage backend to fix the "FIXME" tasks (if I am lucky, this should fix the deadlock bug in bug database as well) (2) fix the warnings from static analysis tools (such as FindBugs and PMD) (3) rework some thread synchronization using java5 java.util.concurrent.* this should make the code much shorter and clearer. (4) write (and clarify) javadocs If you want my help (or have other suggestions), please reply. I won't start working on these works until I have your explicit agreement. Regards, Daniel Cheng From nextgens at freenetproject.org Thu Apr 3 07:28:01 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Thu, 3 Apr 2008 09:28:01 +0200 Subject: [freenet-dev] [freenet-cvs] r18938 - trunk/freenet/src/freenet/support/transport/ip In-Reply-To: <20080403073300.D7100479DC3@freenetproject.org> References: <20080403073300.D7100479DC3@freenetproject.org> Message-ID: <20080403072759.GE3503@freenetproject.org> * nextgens at freenetproject.org [2008-04-03 07:33:00]: > Author: nextgens > Date: 2008-04-03 07:33:00 +0000 (Thu, 03 Apr 2008) > New Revision: 18938 > > Modified: > trunk/freenet/src/freenet/support/transport/ip/IPAddressDetector.java > Log: > fix the build, add a FIXME, fix a bug (we weren't setting lastAddressList to null when needed) > > Modified: trunk/freenet/src/freenet/support/transport/ip/IPAddressDetector.java Where exactly are we setting lastInetAddress ? the logic looks broken to me... it was correct when we had a preferedInetAddress -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080403/123f34aa/attachment.pgp From toad at amphibian.dyndns.org Thu Apr 3 12:03:43 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Thu, 3 Apr 2008 13:03:43 +0100 Subject: [freenet-dev] [freenet-cvs] r18923 - trunk/freenet/src/freenet/support/io In-Reply-To: <20080402222054.96CCC479CF0@freenetproject.org> References: <20080402222054.96CCC479CF0@freenetproject.org> Message-ID: <200804031303.48549.toad@amphibian.dyndns.org> Yes and no. Now I remember why I canonicalised it. The file's need to be comparable. :( I'll fix it. On Wednesday 02 April 2008 23:20, dbkr at freenetproject.org wrote: > Author: dbkr > Date: 2008-04-02 22:20:54 +0000 (Wed, 02 Apr 2008) > New Revision: 18923 > > Modified: > trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java > Log: > This doesn't need to be resolved to an absolute directory: doing so means we end up writing an absolute dir in the config file. > > > Modified: trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java > =================================================================== > --- trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java 2008-04-02 22:01:06 UTC (rev 18922) > +++ trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java 2008-04-02 22:20:54 UTC (rev 18923) > @@ -42,7 +42,7 @@ > > public PersistentTempBucketFactory(File dir, String prefix, RandomSource rand) throws IOException { > boolean logMINOR = Logger.shouldLog(Logger.MINOR, this); > - this.dir = FileUtil.getCanonicalFile(dir); > + this.dir = dir; > this.rand = rand; > this.fg = new FilenameGenerator(rand, false, dir, prefix); > if(!dir.exists()) { > > _______________________________________________ > cvs mailing list > cvs at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080403/4fada33e/attachment.pgp From toad at amphibian.dyndns.org Thu Apr 3 12:16:10 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Thu, 3 Apr 2008 13:16:10 +0100 Subject: [freenet-dev] [freenet-cvs] r18923 - trunk/freenet/src/freenet/support/io In-Reply-To: <200804031303.48549.toad@amphibian.dyndns.org> References: <20080402222054.96CCC479CF0@freenetproject.org> <200804031303.48549.toad@amphibian.dyndns.org> Message-ID: <200804031316.14498.toad@amphibian.dyndns.org> On Thursday 03 April 2008 13:03, Matthew Toseland wrote: > Yes and no. Now I remember why I canonicalised it. The file's need to be > comparable. :( I'll fix it. Hmmm, in fact, we canonicalise whenever we access PersistentTempBucketFactory.originalFiles ... so this can't have caused #2219 ?? > > On Wednesday 02 April 2008 23:20, dbkr at freenetproject.org wrote: > > Author: dbkr > > Date: 2008-04-02 22:20:54 +0000 (Wed, 02 Apr 2008) > > New Revision: 18923 > > > > Modified: > > trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java > > Log: > > This doesn't need to be resolved to an absolute directory: doing so means we > end up writing an absolute dir in the config file. > > > > > > Modified: > trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java > > =================================================================== > > --- trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java > 2008-04-02 22:01:06 UTC (rev 18922) > > +++ trunk/freenet/src/freenet/support/io/PersistentTempBucketFactory.java > 2008-04-02 22:20:54 UTC (rev 18923) > > @@ -42,7 +42,7 @@ > > > > public PersistentTempBucketFactory(File dir, String prefix, RandomSource > rand) throws IOException { > > boolean logMINOR = Logger.shouldLog(Logger.MINOR, this); > > - this.dir = FileUtil.getCanonicalFile(dir); > > + this.dir = dir; > > this.rand = rand; > > this.fg = new FilenameGenerator(rand, false, dir, prefix); > > if(!dir.exists()) { > > > > _______________________________________________ > > cvs mailing list > > cvs at freenetproject.org > > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080403/323ef279/attachment.pgp From toad at amphibian.dyndns.org Thu Apr 3 15:04:44 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Thu, 3 Apr 2008 16:04:44 +0100 Subject: [freenet-dev] =?utf-8?q?=5Bfreenet-cvs=5D_r18938_-=09trunk/freene?= =?utf-8?q?t/src/freenet/support/transport/ip?= In-Reply-To: <20080403072759.GE3503@freenetproject.org> References: <20080403073300.D7100479DC3@freenetproject.org> <20080403072759.GE3503@freenetproject.org> Message-ID: <200804031604.51384.toad@amphibian.dyndns.org> On Thursday 03 April 2008 08:28, Florent Daigni?re wrote: > * nextgens at freenetproject.org [2008-04-03 07:33:00]: > > > Author: nextgens > > Date: 2008-04-03 07:33:00 +0000 (Thu, 03 Apr 2008) > > New Revision: 18938 > > > > Modified: > > trunk/freenet/src/freenet/support/transport/ip/IPAddressDetector.java > > Log: > > fix the build, add a FIXME, fix a bug (we weren't setting lastAddressList to null when needed) > > > > Modified: trunk/freenet/src/freenet/support/transport/ip/IPAddressDetector.java > > Where exactly are we setting lastInetAddress ? the logic looks broken to > me... it was correct when we had a preferedInetAddress Fixed. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080403/c9e3f66e/attachment.pgp From robert at freenetproject.org Thu Apr 3 15:17:20 2008 From: robert at freenetproject.org (Robert Hailey) Date: Thu, 3 Apr 2008 10:17:20 -0500 Subject: [freenet-dev] r18922 - trunk/freenet/src/freenet/client/async In-Reply-To: <20080402220106.CA4A1479DD9@freenetproject.org> References: <20080402220106.CA4A1479DD9@freenetproject.org> Message-ID: On Apr 2, 2008, at 5:01 PM, dbkr at freenetproject.org wrote: > Author: dbkr > Date: 2008-04-02 22:01:06 +0000 (Wed, 02 Apr 2008) > New Revision: 18922 > > Modified: > trunk/freenet/src/freenet/client/async/USKManager.java > Log: > Fix logging confusion (assuming ERROR was intended, change if not) > > > Modified: trunk/freenet/src/freenet/client/async/USKManager.java > =================================================================== > --- trunk/freenet/src/freenet/client/async/USKManager.java > 2008-04-02 19:55:49 UTC (rev 18921) > +++ trunk/freenet/src/freenet/client/async/USKManager.java > 2008-04-02 22:01:06 UTC (rev 18922) > @@ -212,7 +212,7 @@ > USK clear = origUSK.clearCopy(); > USKCallback[] callbacks = (USKCallback[]) > subscribersByClearUSK.get(clear); > if(callbacks == null){ // maybe we should throw something ? shall > we allow multiple unsubscriptions ? > - if(Logger.shouldLog(Logger.MINOR, this)){ > + if(Logger.shouldLog(Logger.ERROR, this)){ > Logger.error(this, "The callback is null! it has been already > unsubscribed, hasn't it?"); > new NullPointerException("The callback is null! it has been > already unsubscribed, hasn't it?").printStackTrace(); > } That logic still looks broken. We only throw if we would log the message??? -- Robert Hailey From toad at amphibian.dyndns.org Thu Apr 3 18:13:49 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Thu, 3 Apr 2008 19:13:49 +0100 Subject: [freenet-dev] Freenet 0.7 build 1132 Message-ID: <200804031913.53784.toad@amphibian.dyndns.org> Freenet 0.7 build 1132 is now available, and will be mandatory on Saturday. Please upgrade ASAP. The main change in this build is a large number of bugfixes to the client layer, which hopefully have fixed the stalling downloads bug. Please tell us if you still get downloads progressing quickly on startup (beyond where they were, check the block count), and then stalling for long periods afterwards. Please report any other bugs you find so we can fix them before 0.7.0-final. We will probably do a second release candidate on Monday. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080403/14d41518/attachment.pgp From toad at amphibian.dyndns.org Thu Apr 3 18:18:05 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Thu, 3 Apr 2008 19:18:05 +0100 Subject: [freenet-dev] Freenet 0.7 build 1132 In-Reply-To: <200804031913.53784.toad@amphibian.dyndns.org> References: <200804031913.53784.toad@amphibian.dyndns.org> Message-ID: <200804031918.05732.toad@amphibian.dyndns.org> On Thursday 03 April 2008 19:13, Matthew Toseland wrote: > Freenet 0.7 build 1132 is now available, and will be mandatory on Saturday. > Please upgrade ASAP. The main change in this build is a large number of > bugfixes to the client layer, which hopefully have fixed the stalling > downloads bug. Please tell us if you still get downloads progressing quickly > on startup (beyond where they were, check the block count), and then stalling > for long periods afterwards. Please report any other bugs you find so we can > fix them before 0.7.0-final. We will probably do a second release candidate > on Monday. > Freenet 0.7 build 1133 is now available, it fixes a deadlock in 1132, and is also mandatory on Saturday. Please upgrade. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080403/dc8b2e6e/attachment.pgp From toad at amphibian.dyndns.org Thu Apr 3 18:19:12 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Thu, 3 Apr 2008 19:19:12 +0100 Subject: [freenet-dev] r18922 - trunk/freenet/src/freenet/client/async In-Reply-To: References: <20080402220106.CA4A1479DD9@freenetproject.org> Message-ID: <200804031919.12912.toad@amphibian.dyndns.org> On Thursday 03 April 2008 16:17, Robert Hailey wrote: > > On Apr 2, 2008, at 5:01 PM, dbkr at freenetproject.org wrote: > > > Author: dbkr > > Date: 2008-04-02 22:01:06 +0000 (Wed, 02 Apr 2008) > > New Revision: 18922 > > > > Modified: > > trunk/freenet/src/freenet/client/async/USKManager.java > > Log: > > Fix logging confusion (assuming ERROR was intended, change if not) > > > > > > Modified: trunk/freenet/src/freenet/client/async/USKManager.java > > =================================================================== > > --- trunk/freenet/src/freenet/client/async/USKManager.java > > 2008-04-02 19:55:49 UTC (rev 18921) > > +++ trunk/freenet/src/freenet/client/async/USKManager.java > > 2008-04-02 22:01:06 UTC (rev 18922) > > @@ -212,7 +212,7 @@ > > USK clear = origUSK.clearCopy(); > > USKCallback[] callbacks = (USKCallback[]) > > subscribersByClearUSK.get(clear); > > if(callbacks == null){ // maybe we should throw something ? shall > > we allow multiple unsubscriptions ? > > - if(Logger.shouldLog(Logger.MINOR, this)){ > > + if(Logger.shouldLog(Logger.ERROR, this)){ > > Logger.error(this, "The callback is null! it has been already > > unsubscribed, hasn't it?"); > > new NullPointerException("The callback is null! it has been > > already unsubscribed, hasn't it?").printStackTrace(); > > } > > That logic still looks broken. We only throw if we would log the > message??? We don't throw. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080403/d6fc3296/attachment.pgp From toad at amphibian.dyndns.org Thu Apr 3 20:43:54 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Thu, 3 Apr 2008 21:43:54 +0100 Subject: [freenet-dev] Looking for janitor works / small tasks in freenet In-Reply-To: References: Message-ID: <200804032144.02474.toad@amphibian.dyndns.org> On Thursday 03 April 2008 02:25, you wrote: > Dear list, > > I am new on this list and wants to contrib to the freenet community > and wants to understand freenet archiecture. > > I am proficient in both C and Java, and did have some (basic) idea on > how P2P network (mainly Chord and ed2k) works, some experience in > debugging thread synchronization problem. I think I can contribute > around 5 hours a week, so I am here looking for some *small* and > *self-contained* tasks that I can do. .... > > Here is a list of tasks I think I can handle (and interested): > > (1) rework the dbd-index storage backend to fix the "FIXME" tasks > (if I am lucky, this should fix the deadlock bug in bug > database as well) I'm not sure what FIXMEs you are referring to. The deadlock bug isn't a java level deadlock, it's a timeout in the database. We haven't seen many complaints recently. Having said that, there is plenty of work to do on the datastore e.g. invalid/deleted blocks should be moved to the bottom of the LRU rather than kept on a free blocks list. > (2) fix the warnings from static analysis tools (such as FindBugs and PMD) Usually a good idea. > > (3) rework some thread synchronization using java5 java.util.concurrent.* > this should make the code much shorter and clearer. Please don't use any java 5. At the moment there is no functional, stable, open source JVM supporting java 5, therefore we code to java 1.4. > > (4) write (and clarify) javadocs Always a good idea. Unit tests are nice too. Otherwise just pick a bug from the bug tracker. > > If you want my help (or have other suggestions), please reply. I won't > start working on these works until I have your explicit agreement. > > Regards, > Daniel Cheng -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080403/bd09eb23/attachment.pgp From j16sdiz+freenet at gmail.com Fri Apr 4 05:38:54 2008 From: j16sdiz+freenet at gmail.com (Daniel Cheng) Date: Fri, 4 Apr 2008 13:38:54 +0800 Subject: [freenet-dev] Looking for janitor works / small tasks in freenet In-Reply-To: <200804032144.02474.toad@amphibian.dyndns.org> References: <200804032144.02474.toad@amphibian.dyndns.org> Message-ID: On Fri, Apr 4, 2008 at 4:43 AM, Matthew Toseland wrote: > On Thursday 03 April 2008 02:25, you wrote: > > Dear list, > > > > I am new on this list and wants to contrib to the freenet community > > and wants to understand freenet archiecture. > > > > I am proficient in both C and Java, and did have some (basic) idea on > > how P2P network (mainly Chord and ed2k) works, some experience in > > debugging thread synchronization problem. I think I can contribute > > around 5 hours a week, so I am here looking for some *small* and > > *self-contained* tasks that I can do. .... > > > > Here is a list of tasks I think I can handle (and interested): > > > > (1) rework the dbd-index storage backend to fix the "FIXME" tasks > > (if I am lucky, this should fix the deadlock bug in bug > > database as well) > > I'm not sure what FIXMEs you are referring to. Search "FIXME" in BerkeleyDBFreenetStore.java, cleaner and cleverer recovery and error handleing > The deadlock bug isn't a java level deadlock, it's a timeout in the database. I knew, but I think that's something fixable.. should be some reordering of lock acquiring. > We haven't seen many complaints recently. so you means bug #2101 should be closed? KSK at frost|message|news|2008.4.3-freenet.0.7.bugs-26.xml say its on build1131 > Having said that, there is plenty of work to do on the datastore e.g. > invalid/deleted blocks should be moved to the bottom of the LRU rather than > kept on a free blocks list. > > > > (2) fix the warnings from static analysis tools (such as FindBugs and > PMD) > > Usually a good idea. > Did you saw my patches on freenet.0.7.bugs frost board ? If not, I will resend that here.. > > > > (3) rework some thread synchronization using java5 java.util.concurrent.* > > this should make the code much shorter and clearer. > > Please don't use any java 5. At the moment there is no functional, stable, > open source JVM supporting java 5, therefore we code to java 1.4. > > > > > (4) write (and clarify) javadocs > > Always a good idea. Unit tests are nice too. Otherwise just pick a bug from > the bug tracker. Okay, will do. > > > > If you want my help (or have other suggestions), please reply. I won't > > start working on these works until I have your explicit agreement. > > > > Regards, > > Daniel Cheng > Regards, Daniel Cheng From sven-ola at gmx.de Fri Apr 4 06:32:23 2008 From: sven-ola at gmx.de (Sven-Ola =?iso-8859-1?q?T=FCcke?=) Date: Fri, 4 Apr 2008 08:32:23 +0200 Subject: [freenet-dev] Embedded build Message-ID: <200804040832.24363.sven-ola@gmx.de> Hey, just uploaded freenet-v1134-pre for embedded-mipsel or i486. To use, grab the appropriate tgz and untar to a new dir, e.g. mkdir /tmp/blubb cd /tmp/blubb wget [see below]-1134.tgz tar xvzf freenet-*-linux-gnu-1134.tgz echo "node.name=$(hostname)" > freenet.ini export LD_LIBRARY_PATH=lib ./freenet-static-*-linux-gnu -mx=48M -ms=48M No java, classpath etc. required - just libc6 etc. Your need ~64 Mb of RAM and ~128Mb of swap. You also need some friends (or get a seednodes.fref and enable strangers). Download: http://download-master.berlin.freifunk.net/sven-ola/freenet/ // Sven-Ola From sven-ola at gmx.de Fri Apr 4 12:30:44 2008 From: sven-ola at gmx.de (Sven-Ola =?iso-8859-1?q?T=FCcke?=) Date: Fri, 4 Apr 2008 14:30:44 +0200 Subject: [freenet-dev] Embedded build In-Reply-To: <200804040832.24363.sven-ola@gmx.de> References: <200804040832.24363.sven-ola@gmx.de> Message-ID: <200804041430.44615.sven-ola@gmx.de> Hey, something wrong with that compile - needed to recompile everyting (SEGV etc). Not having a good java dependency-parser for make has side effects I presume. Something runs faster now. Any revolutionary changes in the latest builds? Or do I simply have better neighs by accident? Anyhow - freenet starts getting usable. Cool. |8-) // Sven-Ola Am Freitag 04 April 2008 08:32:23 schrieb Sven-Ola T?cke: > Hey, > > just uploaded freenet-v1134-pre for embedded-mipsel or i486. To use, grab > the appropriate tgz and untar to a new dir, e.g. > > mkdir /tmp/blubb > cd /tmp/blubb > wget [see below]-1134.tgz > tar xvzf freenet-*-linux-gnu-1134.tgz > echo "node.name=$(hostname)" > freenet.ini > export LD_LIBRARY_PATH=lib > ./freenet-static-*-linux-gnu -mx=48M -ms=48M > > No java, classpath etc. required - just libc6 etc. Your need ~64 Mb of RAM > and ~128Mb of swap. You also need some friends (or get a seednodes.fref and > enable strangers). > > Download: > http://download-master.berlin.freifunk.net/sven-ola/freenet/ > > // Sven-Ola > _______________________________________________ > Devl mailing list > Devl at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl From toad at amphibian.dyndns.org Fri Apr 4 18:09:01 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Fri, 4 Apr 2008 19:09:01 +0100 Subject: [freenet-dev] [freenet-cvs] r18966 - in trunk/freenet/src/freenet: crypt support support/math In-Reply-To: <20080404052031.9FBFD479964@freenetproject.org> References: <20080404052031.9FBFD479964@freenetproject.org> Message-ID: <200804041909.15519.toad@amphibian.dyndns.org> On Friday 04 April 2008 06:20, nextgens at freenetproject.org wrote: > Author: nextgens > Date: 2008-04-04 05:20:31 +0000 (Fri, 04 Apr 2008) > New Revision: 18966 > > Modified: > trunk/freenet/src/freenet/crypt/SHA1.java > trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java > trunk/freenet/src/freenet/support/math/DecayingKeyspaceAverage.java > trunk/freenet/src/freenet/support/math/RunningAverage.java > trunk/freenet/src/freenet/support/math/SimpleBinaryRunningAverage.java > Log: > implement Cloneable where we have a clone() method Why? public interface Cloneable A class implements the Cloneable interface to indicate to the Object.clone() method that it is legal for that method to make a field-for-field copy of instances of that class. Invoking Object's clone method on an instance that does not implement the Cloneable interface results in the exception CloneNotSupportedException being thrown. By convention, classes that implement this interface should override Object.clone (which is protected) with a public method. See Object.clone() for details on overriding this method. Note that this interface does not contain the clone method. Therefore, it is not possible to clone an object merely by virtue of the fact that it implements this interface. Even if the clone method is invoked reflectively, there is no guarantee that it will succeed. > > Modified: trunk/freenet/src/freenet/crypt/SHA1.java > =================================================================== > --- trunk/freenet/src/freenet/crypt/SHA1.java 2008-04-03 18:31:56 UTC (rev 18965) > +++ trunk/freenet/src/freenet/crypt/SHA1.java 2008-04-04 05:20:31 UTC (rev 18966) > @@ -33,7 +33,7 @@ > * This is a simple port of Steve Reid's SHA-1 code into Java. > * I've run his test vectors through the code and they all pass. > */ > -public final class SHA1 implements Digest { > +public final class SHA1 implements Digest, Cloneable { > > private static boolean alwaysThisOne = false; > > > Modified: trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java > =================================================================== > --- trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java 2008-04-03 18:31:56 UTC (rev 18965) > +++ trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java 2008-04-04 05:20:31 UTC (rev 18966) > @@ -10,7 +10,7 @@ > * TODO: there are still some unimplemented methods > * -- it remains to be seen if they are needed at all > */ > -public class DoublyLinkedListImpl implements DoublyLinkedList { > +public class DoublyLinkedListImpl implements DoublyLinkedList, Cloneable { > > protected int size; > protected Item _headptr, _tailptr; > > Modified: trunk/freenet/src/freenet/support/math/DecayingKeyspaceAverage.java > =================================================================== > --- trunk/freenet/src/freenet/support/math/DecayingKeyspaceAverage.java 2008-04-03 18:31:56 UTC (rev 18965) > +++ trunk/freenet/src/freenet/support/math/DecayingKeyspaceAverage.java 2008-04-04 05:20:31 UTC (rev 18966) > @@ -12,7 +12,7 @@ > * > * A filter on BootstrappingDecayingRunningAverage which makes it aware of the circular keyspace. > */ > -public class DecayingKeyspaceAverage implements RunningAverage { > +public class DecayingKeyspaceAverage implements RunningAverage, Cloneable { > private static final long serialVersionUID = 5129429614949179428L; > /** > 'avg' is the normalized average location, note that the the reporting bounds are (-2.0, 2.0) however. > > Modified: trunk/freenet/src/freenet/support/math/RunningAverage.java > =================================================================== > --- trunk/freenet/src/freenet/support/math/RunningAverage.java 2008-04-03 18:31:56 UTC (rev 18965) > +++ trunk/freenet/src/freenet/support/math/RunningAverage.java 2008-04-04 05:20:31 UTC (rev 18966) > @@ -5,7 +5,7 @@ > > import java.io.Serializable; > > -public interface RunningAverage extends Serializable { > +public interface RunningAverage extends Serializable, Cloneable { > > public Object clone(); > > > Modified: trunk/freenet/src/freenet/support/math/SimpleBinaryRunningAverage.java > =================================================================== > --- trunk/freenet/src/freenet/support/math/SimpleBinaryRunningAverage.java 2008-04-03 18:31:56 UTC (rev 18965) > +++ trunk/freenet/src/freenet/support/math/SimpleBinaryRunningAverage.java 2008-04-04 05:20:31 UTC (rev 18966) > @@ -15,7 +15,7 @@ > * @author amphibian > * Created on May 14, 2004 > */ > -public class SimpleBinaryRunningAverage implements RunningAverage { > +public class SimpleBinaryRunningAverage implements RunningAverage, Cloneable { > private static final long serialVersionUID = -1; > > public Object clone() { > > _______________________________________________ > cvs mailing list > cvs at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080404/94c640cc/attachment.pgp From toad at amphibian.dyndns.org Fri Apr 4 18:12:05 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Fri, 4 Apr 2008 19:12:05 +0100 Subject: [freenet-dev] [freenet-cvs] r18968 - trunk/freenet/src/freenet/crypt In-Reply-To: <20080404052541.9AFE7479CE0@freenetproject.org> References: <20080404052541.9AFE7479CE0@freenetproject.org> Message-ID: <200804041912.05250.toad@amphibian.dyndns.org> On Friday 04 April 2008 06:25, you wrote: > Author: nextgens > Date: 2008-04-04 05:25:41 +0000 (Fri, 04 Apr 2008) > New Revision: 18968 > > Modified: > trunk/freenet/src/freenet/crypt/DSAPublicKey.java > Log: > implement DSAPublicKey.hashCode() > > Modified: trunk/freenet/src/freenet/crypt/DSAPublicKey.java > =================================================================== > --- trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 05:21:19 UTC (rev 18967) > +++ trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 05:25:41 UTC (rev 18968) > @@ -163,6 +163,13 @@ > return y.equals(o.y) && group.equals(o.group); > } > > + public int hashCode() { > + int hash = 5; > + hash = 61 * hash + (this.y != null ? this.y.hashCode() : 0); > + hash = 61 * hash + (this.group != null ? this.group.hashCode() : 0); > + return hash; > + } Arcane maths should really be justified in comments! Is this something you just made up or is there a reason for not just returning the xor of y and group's hash codes? Also, in what cases can they be null anyway? If they cease to be null, the hash code would change ... but aren't they final? > + > public boolean equals(Object o) { > if(this == o) // Not necessary, but a very cheap optimization > return true; -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080404/6bdbe296/attachment.pgp From toad at amphibian.dyndns.org Fri Apr 4 18:13:51 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Fri, 4 Apr 2008 19:13:51 +0100 Subject: [freenet-dev] [freenet-cvs] r18969 - trunk/freenet/src/freenet/clients/http/bookmark In-Reply-To: <20080404052702.9AC47479D00@freenetproject.org> References: <20080404052702.9AC47479D00@freenetproject.org> Message-ID: <200804041913.52722.toad@amphibian.dyndns.org> On Friday 04 April 2008 06:27, nextgens at freenetproject.org wrote: > Author: nextgens > Date: 2008-04-04 05:27:02 +0000 (Fri, 04 Apr 2008) > New Revision: 18969 > > Modified: > trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java > Log: > implement BookmarkItem.hashCode() Again, two points: - This will change, and therefore break containing HashSet's etc, if the parts cease to be null. Are they all essential? If they are, are they final, and can they be null? - Justification for the maths? > > Modified: trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java > =================================================================== > --- trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java 2008-04-04 05:25:41 UTC (rev 18968) > +++ trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java 2008-04-04 05:27:02 UTC (rev 18969) > @@ -166,6 +166,15 @@ > return USK.create(key); > } > > + public int hashCode() { > + int hash = 7; > + hash = 31 * hash + (this.key != null ? this.key.hashCode() : 0); > + hash = 31 * hash + (this.hasAnActivelink ? 1 : 0); > + hash = 31 * hash + (this.alerts != null ? this.alerts.hashCode() : 0); > + hash = 31 * hash + (this.desc != null ? this.desc.hashCode() : 0); > + return hash; > + } > + > public boolean equals(Object o) { > if (o == this) { > return true; > > _______________________________________________ > cvs mailing list > cvs at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080404/433dbeda/attachment.pgp From toad at amphibian.dyndns.org Fri Apr 4 18:17:44 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Fri, 4 Apr 2008 19:17:44 +0100 Subject: [freenet-dev] [freenet-cvs] r18971 - trunk/freenet/src/freenet/node In-Reply-To: <20080404053956.69E4B47998A@freenetproject.org> References: <20080404053956.69E4B47998A@freenetproject.org> Message-ID: <200804041917.44731.toad@amphibian.dyndns.org> On that path, it can't. pn can only be null in sendAnonAuthPacket. Please revert. On Friday 04 April 2008 06:39, nextgens at freenetproject.org wrote: > Author: nextgens > Date: 2008-04-04 05:39:56 +0000 (Fri, 04 Apr 2008) > New Revision: 18971 > > Modified: > trunk/freenet/src/freenet/node/FNPPacketMangler.java > Log: > Fix a NPE which could be thrown if we don't have set pn yet. > > I'm not sure when that can happen... > > Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java > =================================================================== > --- trunk/freenet/src/freenet/node/FNPPacketMangler.java 2008-04-04 05:31:26 UTC (rev 18970) > +++ trunk/freenet/src/freenet/node/FNPPacketMangler.java 2008-04-04 05:39:56 UTC (rev 18971) > @@ -1601,7 +1601,7 @@ > } > Logger.minor(this, "Sending auth packet for "+(pn == null ? "null" : String.valueOf(pn.getPeer()))+" (phase="+phase+", ver="+version+", nt="+negType+") (last packet sent "+delta+") to "+replyTo+" data.length="+data.length+" to "+replyTo); > } > - sendAuthPacket(output, pn.outgoingSetupCipher, pn, replyTo, false); > + sendAuthPacket(output, (pn == null ? null : pn.outgoingSetupCipher), pn, replyTo, false); > } > > /** > > _______________________________________________ > cvs mailing list > cvs at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080404/0eef8362/attachment.pgp From toad at amphibian.dyndns.org Fri Apr 4 18:22:27 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Fri, 4 Apr 2008 19:22:27 +0100 Subject: [freenet-dev] [freenet-cvs] r18975 - trunk/freenet/src/freenet/client/async In-Reply-To: <20080404060554.A9A8F479DD4@freenetproject.org> References: <20080404060554.A9A8F479DD4@freenetproject.org> Message-ID: <200804041922.28756.toad@amphibian.dyndns.org> On Friday 04 April 2008 07:05, nextgens at freenetproject.org wrote: > Author: nextgens > Date: 2008-04-04 06:05:54 +0000 (Fri, 04 Apr 2008) > New Revision: 18975 > > Modified: > trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java > Log: > Simplify a few things synchronization-wise declaring a few variables volatile I thought there were issues with volatile? Like it's not deterministic, and you really should use locking in all nontrivial cases? > > Modified: trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java > =================================================================== > --- trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java 2008-04-04 06:00:40 UTC (rev 18974) > +++ trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java 2008-04-04 06:05:54 UTC (rev 18975) > @@ -46,14 +46,16 @@ > > final int segNo; > > - private boolean encoded; > + private volatile boolean encoded; > + > + private volatile boolean started; > + > + private volatile boolean finished; > + > + private volatile boolean hasURIs; > > - private boolean finished; > - > private final boolean getCHKOnly; > > - private boolean hasURIs; > - > private InsertException toThrow; > > private final FailureCodeTracker errors; > @@ -62,8 +64,6 @@ > > private int blocksCompleted; > > - private boolean started; > - > public SplitFileInserterSegment(SplitFileInserter parent, > FECCodec splitfileAlgo, Bucket[] origDataBlocks, > InsertContext blockInsertContext, boolean getCHKOnly, int segNo) { > > _______________________________________________ > cvs mailing list > cvs at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080404/bffdeeff/attachment.pgp From toad at amphibian.dyndns.org Fri Apr 4 18:26:56 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Fri, 4 Apr 2008 19:26:56 +0100 Subject: [freenet-dev] [freenet-cvs] r18977 - trunk/freenet/src/freenet/support In-Reply-To: <20080404061623.DB5C8479D5A@freenetproject.org> References: <20080404061623.DB5C8479D5A@freenetproject.org> Message-ID: <200804041926.56984.toad@amphibian.dyndns.org> Grrrr, indenting and sync fixes in the same commit. On Friday 04 April 2008 07:16, nextgens at freenetproject.org wrote: > Author: nextgens > Date: 2008-04-04 06:16:23 +0000 (Fri, 04 Apr 2008) > New Revision: 18977 > > Modified: > trunk/freenet/src/freenet/support/PooledExecutor.java > Log: > More sync. fixes > > Modified: trunk/freenet/src/freenet/support/PooledExecutor.java > =================================================================== > --- trunk/freenet/src/freenet/support/PooledExecutor.java 2008-04-04 06:12:05 UTC (rev 18976) > +++ trunk/freenet/src/freenet/support/PooledExecutor.java 2008-04-04 06:16:23 UTC (rev 18977) > @@ -23,48 +23,48 @@ > private static boolean logMINOR; > // Ticker thread that runs at maximum priority. > private Ticker ticker; > - > - public void setTicker(Ticker ticker) { > + > + public synchronized void setTicker(Ticker ticker) { > this.ticker = ticker; > } > - > + > public PooledExecutor() { > - for(int i=0; i + for(int i = 0; i < runningThreads.length; i++) { > runningThreads[i] = new ArrayList(); > waitingThreads[i] = new ArrayList(); > threadCounter[i] = 0; > } > } > - > /** Maximum time a thread will wait for a job */ > - static final int TIMEOUT = 5*60*1000; > - > + static final int TIMEOUT = 5 * 60 * 1000; > + > public void start() { > logMINOR = Logger.shouldLog(Logger.MINOR, this); > } > - > + > public void execute(Runnable job, String jobName) { > execute(job, jobName, false); > } > - > + > public void execute(Runnable job, String jobName, boolean fromTicker) { > int prio = NativeThread.NORM_PRIORITY; > - if(job instanceof PrioRunnable) { > - prio = ((PrioRunnable)job).getPriority(); > - } > - > - if(logMINOR) Logger.minor(this, "Executing "+job+" as "+jobName+" at prio "+prio); > + if(job instanceof PrioRunnable) > + prio = ((PrioRunnable) job).getPriority(); > + > + if(logMINOR) > + Logger.minor(this, "Executing " + job + " as " + jobName + " at prio " + prio); > if(prio < NativeThread.MIN_PRIORITY || prio > NativeThread.MAX_PRIORITY) > - throw new IllegalArgumentException("Unreconized priority level : "+prio+'!'); > + throw new IllegalArgumentException("Unreconized priority level : " + prio + '!'); > while(true) { > MyThread t; > boolean mustStart = false; > boolean miss = false; > synchronized(this) { > jobCount++; > - if(!waitingThreads[prio-1].isEmpty()) { > - t = (MyThread) waitingThreads[prio-1].remove(waitingThreads[prio-1].size()-1); > - if(logMINOR) Logger.minor(this, "Reusing thread "+t); > + if(!waitingThreads[prio - 1].isEmpty()) { > + t = (MyThread) waitingThreads[prio - 1].remove(waitingThreads[prio - 1].size() - 1); > + if(logMINOR) > + Logger.minor(this, "Reusing thread " + t); > } else { > // Must create new thread > if((!fromTicker) && NativeThread.usingNativeCode() && prio > Thread.currentThread().getPriority()) { > @@ -73,16 +73,18 @@ > return; > } > // Will be coalesced by thread count listings if we use "@" or "for" > - t = new MyThread("Pooled thread awaiting work @"+(threadCounter[prio-1]), threadCounter[prio-1], prio, !fromTicker); > - threadCounter[prio-1]++; > + t = new MyThread("Pooled thread awaiting work @" + (threadCounter[prio - 1]), threadCounter[prio - 1], prio, !fromTicker); > + threadCounter[prio - 1]++; > t.setDaemon(true); > mustStart = true; > miss = true; > } > } > synchronized(t) { > - if(!t.alive) continue; > - if(t.nextJob != null) continue; > + if(!t.alive) > + continue; > + if(t.nextJob != null) > + continue; > t.nextJob = job; > if(!mustStart) > // It is possible that we could get a wierd race condition with > @@ -90,44 +92,46 @@ > // level code. So we'd best use notifyAll(). > t.notifyAll(); > } > - t.setName(jobName+"("+t.threadNo+")"); > + t.setName(jobName + "(" + t.threadNo + ")"); > if(mustStart) { > t.start(); > synchronized(this) { > - runningThreads[prio-1].add(t); > + runningThreads[prio - 1].add(t); > if(miss) > jobMisses++; > if(logMINOR) > - Logger.minor(this, "Jobs: "+jobMisses+" misses of "+jobCount+" starting urgently "+jobName); > + Logger.minor(this, "Jobs: " + jobMisses + " misses of " + jobCount + " starting urgently " + jobName); > } > - } else { > + } else > if(logMINOR) > - Logger.minor(this, "Not starting: Jobs: "+jobMisses+" misses of "+jobCount+" starting urgently "+jobName); > - } > + synchronized(this) { > + Logger.minor(this, "Not starting: Jobs: " + jobMisses + " misses of " + jobCount + " starting urgently " + jobName); > + } > return; > } > } > > public synchronized int[] runningThreads() { > int[] result = new int[runningThreads.length]; > - for(int i=0; i + for(int i = 0; i < result.length; i++) > result[i] = runningThreads[i].size(); > return result; > } > - > + > public synchronized int[] waitingThreads() { > int[] result = new int[waitingThreads.length]; > - for(int i=0; i + for(int i = 0; i < result.length; i++) > result[i] = waitingThreads[i].size(); > return result; > } > - > + > class MyThread extends NativeThread { > + > final String defaultName; > boolean alive = true; > Runnable nextJob; > final long threadNo; > - > + > public MyThread(String defaultName, long threadCounter, int prio, boolean dontCheckRenice) { > super(defaultName, prio, dontCheckRenice); > this.defaultName = defaultName; > @@ -140,53 +144,49 @@ > int nativePriority = getNativePriority(); > while(true) { > Runnable job; > - > + > synchronized(this) { > job = nextJob; > nextJob = null; > } > - > + > if(job == null) { > synchronized(PooledExecutor.this) { > - waitingThreads[nativePriority-1].add(this); > + waitingThreads[nativePriority - 1].add(this); > } > synchronized(this) { > if(nextJob == null) { > this.setName(defaultName); > try { > wait(TIMEOUT); > - } catch (InterruptedException e) { > - // Ignore > + } catch(InterruptedException e) { > + // Ignore > } > } > job = nextJob; > nextJob = null; > - if(job == null) { > + if(job == null) > alive = false; > - // execute() won't give us another job if alive = false > - } > } > synchronized(PooledExecutor.this) { > - waitingThreads[nativePriority-1].remove(this); > + waitingThreads[nativePriority - 1].remove(this); > if(!alive) { > - runningThreads[nativePriority-1].remove(this); > + runningThreads[nativePriority - 1].remove(this); > if(logMINOR) > - Logger.minor(this, "Exiting having executed "+ranJobs+" jobs : "+this); > + Logger.minor(this, "Exiting having executed " + ranJobs + " jobs : " + this); > return; > } > } > } > - > + > // Run the job > try { > job.run(); > - } catch (Throwable t) { > - Logger.error(this, "Caught "+t+" running job "+job, t); > + } catch(Throwable t) { > + Logger.error(this, "Caught " + t + " running job " + job, t); > } > ranJobs++; > } > } > - > } > - > } > > _______________________________________________ > cvs mailing list > cvs at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080404/12fd3ab3/attachment.pgp From toad at amphibian.dyndns.org Fri Apr 4 18:36:34 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Fri, 4 Apr 2008 19:36:34 +0100 Subject: [freenet-dev] [freenet-cvs] r18976 - trunk/freenet/src/freenet/client/async In-Reply-To: <20080404061205.E772147998A@freenetproject.org> References: <20080404061205.E772147998A@freenetproject.org> Message-ID: <200804041936.34638.toad@amphibian.dyndns.org> On Friday 04 April 2008 07:12, nextgens at freenetproject.org wrote: > Author: nextgens > Date: 2008-04-04 06:12:05 +0000 (Fri, 04 Apr 2008) > New Revision: 18976 > > Modified: > trunk/freenet/src/freenet/client/async/SplitFileFetcherSegment.java > trunk/freenet/src/freenet/client/async/SplitFileInserter.java > Log: > Some sync fixes > > Modified: trunk/freenet/src/freenet/client/async/SplitFileFetcherSegment.java > =================================================================== > --- trunk/freenet/src/freenet/client/async/SplitFileFetcherSegment.java 2008-04-04 06:05:54 UTC (rev 18975) > +++ trunk/freenet/src/freenet/client/async/SplitFileFetcherSegment.java 2008-04-04 06:12:05 UTC (rev 18976) > @@ -52,7 +52,7 @@ > final FetchContext fetchContext; > final long maxBlockLength; > /** Has the segment finished processing? Irreversible. */ > - private boolean finished; > + private volatile boolean finished; > private boolean startedDecode; > /** Bucket to store the data retrieved, after it has been decoded */ > private Bucket decodedData; > @@ -244,8 +244,10 @@ > parentFetcher.segmentFinished(SplitFileFetcherSegment.this); > } catch (IOException e) { > Logger.normal(this, "Caught bucket error?: "+e, e); > - finished = true; > - failureException = new FetchException(FetchException.BUCKET_ERROR); > + synchronized(this) { > + finished = true; > + failureException = new FetchException(FetchException.BUCKET_ERROR); > + } > parentFetcher.segmentFinished(SplitFileFetcherSegment.this); > return; > } > > Modified: trunk/freenet/src/freenet/client/async/SplitFileInserter.java > =================================================================== > --- trunk/freenet/src/freenet/client/async/SplitFileInserter.java 2008-04-04 06:05:54 UTC (rev 18975) > +++ trunk/freenet/src/freenet/client/async/SplitFileInserter.java 2008-04-04 06:12:05 UTC (rev 18976) > @@ -22,7 +22,7 @@ > > public class SplitFileInserter implements ClientPutState { > > - private static boolean logMINOR; > + private boolean logMINOR; IMHO this should be static, making it per instance is a waste of memory. > final BaseClientPutter parent; > final InsertContext ctx; > final PutCompletionCallback cb; > @@ -38,7 +38,7 @@ > private boolean haveSentMetadata; > final ClientMetadata cm; > final boolean isMetadata; > - private boolean finished; > + private volatile boolean finished; > private boolean fetchable; > public final Object token; > final boolean insertAsArchiveManifest; > > _______________________________________________ > cvs mailing list > cvs at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080404/ef41a216/attachment.pgp From j16sdiz+freenet at gmail.com Sat Apr 5 00:12:54 2008 From: j16sdiz+freenet at gmail.com (Daniel Cheng) Date: Sat, 5 Apr 2008 08:12:54 +0800 Subject: [freenet-dev] [freenet-cvs] r18968 - trunk/freenet/src/freenet/crypt In-Reply-To: <200804041912.05250.toad@amphibian.dyndns.org> References: <20080404052541.9AFE7479CE0@freenetproject.org> <200804041912.05250.toad@amphibian.dyndns.org> Message-ID: On Sat, Apr 5, 2008 at 2:12 AM, Matthew Toseland wrote: > On Friday 04 April 2008 06:25, you wrote: > > Author: nextgens > > Date: 2008-04-04 05:25:41 +0000 (Fri, 04 Apr 2008) > > New Revision: 18968 > > > > Modified: > > trunk/freenet/src/freenet/crypt/DSAPublicKey.java > > Log: > > implement DSAPublicKey.hashCode() > > > > Modified: trunk/freenet/src/freenet/crypt/DSAPublicKey.java > > =================================================================== > > --- trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 05:21:19 > UTC (rev 18967) > > +++ trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 05:25:41 > UTC (rev 18968) > > @@ -163,6 +163,13 @@ > > return y.equals(o.y) && group.equals(o.group); > > } > > > > + public int hashCode() { > > + int hash = 5; > > + hash = 61 * hash + (this.y != null ? this.y.hashCode() : 0); > > + hash = 61 * hash + (this.group != null ? this.group.hashCode() : 0); > > + return hash; > > + } > > Arcane maths should really be justified in comments! Is this something you > just made up or is there a reason for not just returning the xor of y and > group's hash codes? Also, in what cases can they be null anyway? If they > cease to be null, the hash code would change ... but aren't they final? I guess these are generated by IDE. This is the standard pattern in the "Effective Java " book. > > + > > public boolean equals(Object o) { > > if(this == o) // Not necessary, but a very cheap optimization > > return true; > > _______________________________________________ > Devl mailing list > Devl at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl > From nextgens at freenetproject.org Sat Apr 5 02:24:34 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Sat, 5 Apr 2008 04:24:34 +0200 Subject: [freenet-dev] [freenet-cvs] r18971 - trunk/freenet/src/freenet/node In-Reply-To: <200804041917.44731.toad@amphibian.dyndns.org> References: <20080404053956.69E4B47998A@freenetproject.org> <200804041917.44731.toad@amphibian.dyndns.org> Message-ID: <20080405022432.GB3487@freenetproject.org> * Matthew Toseland [2008-04-04 19:17:44]: > On that path, it can't. pn can only be null in sendAnonAuthPacket. Please > revert. > Already done: ------------------------------------------------------------------------ r18973 | nextgens | 2008-04-04 07:53:39 +0200 (ven, 04 avr 2008) | 1 line Chemins modifi?s : M /trunk/freenet/src/freenet/node/FNPPacketMangler.java r18971 was silly, it will throw a NPE anyway. > On Friday 04 April 2008 06:39, nextgens at freenetproject.org wrote: > > Author: nextgens > > Date: 2008-04-04 05:39:56 +0000 (Fri, 04 Apr 2008) > > New Revision: 18971 > > > > Modified: > > trunk/freenet/src/freenet/node/FNPPacketMangler.java > > Log: > > Fix a NPE which could be thrown if we don't have set pn yet. > > > > I'm not sure when that can happen... > > > > Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java > > =================================================================== -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/f9d153c1/attachment.pgp From nextgens at freenetproject.org Sat Apr 5 02:26:09 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Sat, 5 Apr 2008 04:26:09 +0200 Subject: [freenet-dev] [freenet-cvs] r18977 - trunk/freenet/src/freenet/support In-Reply-To: <200804041926.56984.toad@amphibian.dyndns.org> References: <20080404061623.DB5C8479D5A@freenetproject.org> <200804041926.56984.toad@amphibian.dyndns.org> Message-ID: <20080405022607.GC3487@freenetproject.org> * Matthew Toseland [2008-04-04 19:26:56]: > Grrrr, indenting and sync fixes in the same commit. > Sorry about that one... Oh and btw, Grrrr, top-posting! > On Friday 04 April 2008 07:16, nextgens at freenetproject.org wrote: > > Author: nextgens > > Date: 2008-04-04 06:16:23 +0000 (Fri, 04 Apr 2008) > > New Revision: 18977 > > > > Modified: > > trunk/freenet/src/freenet/support/PooledExecutor.java > > Log: > > More sync. fixes > > > > Modified: trunk/freenet/src/freenet/support/PooledExecutor.java > > =================================================================== > > --- trunk/freenet/src/freenet/support/PooledExecutor.java 2008-04-04 > 06:12:05 UTC (rev 18976) > > +++ trunk/freenet/src/freenet/support/PooledExecutor.java 2008-04-04 > 06:16:23 UTC (rev 18977) > > @@ -23,48 +23,48 @@ > > private static boolean logMINOR; > > // Ticker thread that runs at maximum priority. > > private Ticker ticker; > > - > > - public void setTicker(Ticker ticker) { > > + > > + public synchronized void setTicker(Ticker ticker) { > > this.ticker = ticker; > > } > > - > > + > > public PooledExecutor() { > > - for(int i=0; i > + for(int i = 0; i < runningThreads.length; i++) { > > runningThreads[i] = new ArrayList(); > > waitingThreads[i] = new ArrayList(); > > threadCounter[i] = 0; > > } > > } > > - > > /** Maximum time a thread will wait for a job */ > > - static final int TIMEOUT = 5*60*1000; > > - > > + static final int TIMEOUT = 5 * 60 * 1000; > > + > > public void start() { > > logMINOR = Logger.shouldLog(Logger.MINOR, this); > > } > > - > > + > > public void execute(Runnable job, String jobName) { > > execute(job, jobName, false); > > } > > - > > + > > public void execute(Runnable job, String jobName, boolean fromTicker) { > > int prio = NativeThread.NORM_PRIORITY; > > - if(job instanceof PrioRunnable) { > > - prio = ((PrioRunnable)job).getPriority(); > > - } > > - > > - if(logMINOR) Logger.minor(this, "Executing "+job+" as "+jobName+" at > prio "+prio); > > + if(job instanceof PrioRunnable) > > + prio = ((PrioRunnable) job).getPriority(); > > + > > + if(logMINOR) > > + Logger.minor(this, "Executing " + job + " as " + jobName + " at prio " + > prio); > > if(prio < NativeThread.MIN_PRIORITY || prio > NativeThread.MAX_PRIORITY) > > - throw new IllegalArgumentException("Unreconized priority > level : "+prio+'!'); > > + throw new IllegalArgumentException("Unreconized priority level : " + > prio + '!'); > > while(true) { > > MyThread t; > > boolean mustStart = false; > > boolean miss = false; > > synchronized(this) { > > jobCount++; > > - if(!waitingThreads[prio-1].isEmpty()) { > > - t = (MyThread) > waitingThreads[prio-1].remove(waitingThreads[prio-1].size()-1); > > - if(logMINOR) Logger.minor(this, "Reusing thread "+t); > > + if(!waitingThreads[prio - 1].isEmpty()) { > > + t = (MyThread) waitingThreads[prio - 1].remove(waitingThreads[prio - > 1].size() - 1); > > + if(logMINOR) > > + Logger.minor(this, "Reusing thread " + t); > > } else { > > // Must create new thread > > if((!fromTicker) && NativeThread.usingNativeCode() && prio > > Thread.currentThread().getPriority()) { > > @@ -73,16 +73,18 @@ > > return; > > } > > // Will be coalesced by thread count listings if we use "@" or "for" > > - t = new MyThread("Pooled thread awaiting work > @"+(threadCounter[prio-1]), threadCounter[prio-1], prio, !fromTicker); > > - threadCounter[prio-1]++; > > + t = new MyThread("Pooled thread awaiting work @" + > (threadCounter[prio - 1]), threadCounter[prio - 1], prio, !fromTicker); > > + threadCounter[prio - 1]++; > > t.setDaemon(true); > > mustStart = true; > > miss = true; > > } > > } > > synchronized(t) { > > - if(!t.alive) continue; > > - if(t.nextJob != null) continue; > > + if(!t.alive) > > + continue; > > + if(t.nextJob != null) > > + continue; > > t.nextJob = job; > > if(!mustStart) > > // It is possible that we could get a wierd race condition with > > @@ -90,44 +92,46 @@ > > // level code. So we'd best use notifyAll(). > > t.notifyAll(); > > } > > - t.setName(jobName+"("+t.threadNo+")"); > > + t.setName(jobName + "(" + t.threadNo + ")"); > > if(mustStart) { > > t.start(); > > synchronized(this) { > > - runningThreads[prio-1].add(t); > > + runningThreads[prio - 1].add(t); > > if(miss) > > jobMisses++; > > if(logMINOR) > > - Logger.minor(this, "Jobs: "+jobMisses+" misses of "+jobCount+" > starting urgently "+jobName); > > + Logger.minor(this, "Jobs: " + jobMisses + " misses of " + jobCount > + " starting urgently " + jobName); > > } > > - } else { > > + } else > > if(logMINOR) > > - Logger.minor(this, "Not starting: Jobs: "+jobMisses+" misses > of "+jobCount+" starting urgently "+jobName); > > - } > > + synchronized(this) { > > + Logger.minor(this, "Not starting: Jobs: " + jobMisses + " misses of " > + jobCount + " starting urgently " + jobName); > > + } > > return; > > } > > } > > > > public synchronized int[] runningThreads() { > > int[] result = new int[runningThreads.length]; > > - for(int i=0; i > + for(int i = 0; i < result.length; i++) > > result[i] = runningThreads[i].size(); > > return result; > > } > > - > > + > > public synchronized int[] waitingThreads() { > > int[] result = new int[waitingThreads.length]; > > - for(int i=0; i > + for(int i = 0; i < result.length; i++) > > result[i] = waitingThreads[i].size(); > > return result; > > } > > - > > + > > class MyThread extends NativeThread { > > + > > final String defaultName; > > boolean alive = true; > > Runnable nextJob; > > final long threadNo; > > - > > + > > public MyThread(String defaultName, long threadCounter, int prio, boolean > dontCheckRenice) { > > super(defaultName, prio, dontCheckRenice); > > this.defaultName = defaultName; > > @@ -140,53 +144,49 @@ > > int nativePriority = getNativePriority(); > > while(true) { > > Runnable job; > > - > > + > > synchronized(this) { > > job = nextJob; > > nextJob = null; > > } > > - > > + > > if(job == null) { > > synchronized(PooledExecutor.this) { > > - waitingThreads[nativePriority-1].add(this); > > + waitingThreads[nativePriority - 1].add(this); > > } > > synchronized(this) { > > if(nextJob == null) { > > this.setName(defaultName); > > try { > > wait(TIMEOUT); > > - } catch (InterruptedException e) { > > - // Ignore > > + } catch(InterruptedException e) { > > + // Ignore > > } > > } > > job = nextJob; > > nextJob = null; > > - if(job == null) { > > + if(job == null) > > alive = false; > > - // execute() won't give us another job if alive = false > > - } > > } > > synchronized(PooledExecutor.this) { > > - waitingThreads[nativePriority-1].remove(this); > > + waitingThreads[nativePriority - 1].remove(this); > > if(!alive) { > > - runningThreads[nativePriority-1].remove(this); > > + runningThreads[nativePriority - 1].remove(this); > > if(logMINOR) > > - Logger.minor(this, "Exiting having executed "+ranJobs+" > jobs : "+this); > > + Logger.minor(this, "Exiting having executed " + ranJobs + " > jobs : " + this); > > return; > > } > > } > > } > > - > > + > > // Run the job > > try { > > job.run(); > > - } catch (Throwable t) { > > - Logger.error(this, "Caught "+t+" running job "+job, t); > > + } catch(Throwable t) { > > + Logger.error(this, "Caught " + t + " running job " + job, t); > > } > > ranJobs++; > > } > > } > > - > > } > > - > > } > > > > _______________________________________________ > > cvs mailing list > > cvs at freenetproject.org > > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > > > > > _______________________________________________ > Devl mailing list > Devl at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/9de4eb29/attachment.pgp From nextgens at freenetproject.org Sat Apr 5 02:50:04 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Sat, 5 Apr 2008 04:50:04 +0200 Subject: [freenet-dev] [freenet-cvs] r18975 - trunk/freenet/src/freenet/client/async In-Reply-To: <200804041922.28756.toad@amphibian.dyndns.org> References: <20080404060554.A9A8F479DD4@freenetproject.org> <200804041922.28756.toad@amphibian.dyndns.org> Message-ID: <20080405025002.GB3710@freenetproject.org> * Matthew Toseland [2008-04-04 19:22:27]: > On Friday 04 April 2008 07:05, nextgens at freenetproject.org wrote: > > Author: nextgens > > Date: 2008-04-04 06:05:54 +0000 (Fri, 04 Apr 2008) > > New Revision: 18975 > > > > Modified: > > trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java > > Log: > > Simplify a few things synchronization-wise declaring a few variables > volatile > > I thought there were issues with volatile? Like it's not deterministic, and > you really should use locking in all nontrivial cases? I suggest you read http://www.javaperformancetuning.com/tips/volatile.shtml :) Two things to add: 1) there is no significant performance cost for reading a volatile on x86 2) The SplitFileInserterSegment class is already a synchronization nightmare so we'd better reduce the locking to the minimum there : we still had some unsynchronized accesses to those booleans. I think that making those booleans volatile is a step forward fighting the "requests don't finish" kind of bugs which are likely to be caused by race-conditions. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/93ff3b71/attachment.pgp From nextgens at freenetproject.org Sat Apr 5 03:13:53 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Sat, 5 Apr 2008 05:13:53 +0200 Subject: [freenet-dev] [freenet-cvs] r18968 - trunk/freenet/src/freenet/crypt In-Reply-To: <200804041912.05250.toad@amphibian.dyndns.org> References: <20080404052541.9AFE7479CE0@freenetproject.org> <200804041912.05250.toad@amphibian.dyndns.org> Message-ID: <20080405031352.GC3710@freenetproject.org> * Matthew Toseland [2008-04-04 19:12:05]: > On Friday 04 April 2008 06:25, you wrote: > > Author: nextgens > > Date: 2008-04-04 05:25:41 +0000 (Fri, 04 Apr 2008) > > New Revision: 18968 > > > > Modified: > > trunk/freenet/src/freenet/crypt/DSAPublicKey.java > > Log: > > implement DSAPublicKey.hashCode() > > > > Modified: trunk/freenet/src/freenet/crypt/DSAPublicKey.java > > =================================================================== > > --- trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 05:21:19 > UTC (rev 18967) > > +++ trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 05:25:41 > UTC (rev 18968) > > @@ -163,6 +163,13 @@ > > return y.equals(o.y) && group.equals(o.group); > > } > > > > + public int hashCode() { > > + int hash = 5; > > + hash = 61 * hash + (this.y != null ? this.y.hashCode() : 0); > > + hash = 61 * hash + (this.group != null ? this.group.hashCode() : 0); > > + return hash; > > + } > > Arcane maths should really be justified in comments! It's a standard pattern > Is this something you > just made up or is there a reason for not just returning the xor of y and > group's hash codes? I could have done that but I haven't :) > Also, in what cases can they be null anyway? If they > cease to be null, the hash code would change ... but aren't they final? The spec says they can be null (in equals as well, fixed in r19001) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/6b20f8a3/attachment.pgp From nextgens at freenetproject.org Sat Apr 5 03:22:08 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Sat, 5 Apr 2008 05:22:08 +0200 Subject: [freenet-dev] [freenet-cvs] r18969 - trunk/freenet/src/freenet/clients/http/bookmark In-Reply-To: <200804041913.52722.toad@amphibian.dyndns.org> References: <20080404052702.9AC47479D00@freenetproject.org> <200804041913.52722.toad@amphibian.dyndns.org> Message-ID: <20080405032206.GD3710@freenetproject.org> * Matthew Toseland [2008-04-04 19:13:51]: > On Friday 04 April 2008 06:27, nextgens at freenetproject.org wrote: > > Author: nextgens > > Date: 2008-04-04 05:27:02 +0000 (Fri, 04 Apr 2008) > > New Revision: 18969 > > > > Modified: > > trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java > > Log: > > implement BookmarkItem.hashCode() > > Again, two points: > - This will change, and therefore break containing HashSet's etc, if the parts > cease to be null. Are they all essential? If they are, are they final, and > can they be null? We must do the same checks as for equals()... If it breaks the code somehow we should fix it. "This is what the JDK 1.4 API documentation says about the hashCode method of Object class- Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable. * The general contract of hashCode is: Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. * If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result. * It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables. As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.) " http://www.geocities.com/technofundo/tech/java/equalhash.html -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/35dff1ab/attachment.pgp From toad at amphibian.dyndns.org Sat Apr 5 10:11:05 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Sat, 5 Apr 2008 11:11:05 +0100 Subject: [freenet-dev] =?utf-8?q?=5Bfreenet-cvs=5D_r18975_-=09trunk/freene?= =?utf-8?q?t/src/freenet/client/async?= In-Reply-To: <20080405025002.GB3710@freenetproject.org> References: <20080404060554.A9A8F479DD4@freenetproject.org> <200804041922.28756.toad@amphibian.dyndns.org> <20080405025002.GB3710@freenetproject.org> Message-ID: <200804051111.10896.toad@amphibian.dyndns.org> On Saturday 05 April 2008 03:50, Florent Daigni?re wrote: > * Matthew Toseland [2008-04-04 19:22:27]: > > > On Friday 04 April 2008 07:05, nextgens at freenetproject.org wrote: > > > Author: nextgens > > > Date: 2008-04-04 06:05:54 +0000 (Fri, 04 Apr 2008) > > > New Revision: 18975 > > > > > > Modified: > > > trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java > > > Log: > > > Simplify a few things synchronization-wise declaring a few variables > > volatile > > > > I thought there were issues with volatile? Like it's not deterministic, and > > you really should use locking in all nontrivial cases? > > I suggest you read > http://www.javaperformancetuning.com/tips/volatile.shtml :) "Note however that volatile has been incompletely implemented in most JVMs. Using volatile may not help to achieve the results you desire (yes this is a JVM bug, but its been low priority until recently)." Presumably this doesn't include the mainline Sun VM. "NOTE THE TIP "volatile primitive datatypes have atomic ++ operations" HAS BEEN SHOWN TO BE INVALID" So never use volatile integers/longs/shorts. Hmmm. > > Two things to add: > 1) there is no significant performance cost for > reading a volatile on x86 > 2) The SplitFileInserterSegment class is already a synchronization > nightmare so we'd better reduce the locking to the minimum there : we still > had some unsynchronized accesses to those booleans. > > I think that making those booleans volatile is a step forward fighting > the "requests don't finish" kind of bugs which are likely to be > caused by race-conditions. > Have you seen complaints of splitfile *inserts* not finishing? AFAIK reports are generally of requests not finishing... -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/9832d64b/attachment.pgp From toad at amphibian.dyndns.org Sat Apr 5 10:22:48 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Sat, 5 Apr 2008 11:22:48 +0100 Subject: [freenet-dev] =?utf-8?q?=5Bfreenet-cvs=5D_r18969_-=09trunk/freene?= =?utf-8?q?t/src/freenet/clients/http/bookmark?= In-Reply-To: <20080405032206.GD3710@freenetproject.org> References: <20080404052702.9AC47479D00@freenetproject.org> <200804041913.52722.toad@amphibian.dyndns.org> <20080405032206.GD3710@freenetproject.org> Message-ID: <200804051122.53179.toad@amphibian.dyndns.org> On Saturday 05 April 2008 04:22, Florent Daigni?re wrote: > * Matthew Toseland [2008-04-04 19:13:51]: > > > On Friday 04 April 2008 06:27, nextgens at freenetproject.org wrote: > > > Author: nextgens > > > Date: 2008-04-04 05:27:02 +0000 (Fri, 04 Apr 2008) > > > New Revision: 18969 > > > > > > Modified: > > > trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java > > > Log: > > > implement BookmarkItem.hashCode() > > > > Again, two points: > > - This will change, and therefore break containing HashSet's etc, if the parts > > cease to be null. Are they all essential? If they are, are they final, and > > can they be null? > > We must do the same checks as for equals()... If it breaks the code somehow we should fix it. Of course, but I'm not sure we are doing this here: - It is *NOT* necessary for hashCode to always return different values for different objects. We can ignore elements with impunity. - equals() is true if two BookmarkItem's have the same key and different editions. So your code breaks equals/hashCode consistency. - key and name cannot in any case be null. I've fixed the above. Also you haven't explained the mathematical voodoo... hashtables will generally depend on the first few bits, which will in this case depend on the description's hash followed by the alerts hash. Wouldn't it be better to simply XOR all the parts together? > > "This is what the JDK 1.4 API documentation says about the hashCode method of Object class- > > Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable. > > * The general contract of hashCode is: Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. > * If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result. > * It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables. > > As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.) " > > http://www.geocities.com/technofundo/tech/java/equalhash.html > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/26a72d01/attachment.pgp From toad at amphibian.dyndns.org Sat Apr 5 10:24:42 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Sat, 5 Apr 2008 11:24:42 +0100 Subject: [freenet-dev] [freenet-cvs] r18968 - trunk/freenet/src/freenet/crypt In-Reply-To: References: <20080404052541.9AFE7479CE0@freenetproject.org> <200804041912.05250.toad@amphibian.dyndns.org> Message-ID: <200804051124.42888.toad@amphibian.dyndns.org> On Saturday 05 April 2008 01:12, Daniel Cheng wrote: > On Sat, Apr 5, 2008 at 2:12 AM, Matthew Toseland > wrote: > > On Friday 04 April 2008 06:25, you wrote: > > > Author: nextgens > > > Date: 2008-04-04 05:25:41 +0000 (Fri, 04 Apr 2008) > > > New Revision: 18968 > > > > > > Modified: > > > trunk/freenet/src/freenet/crypt/DSAPublicKey.java > > > Log: > > > implement DSAPublicKey.hashCode() > > > > > > Modified: trunk/freenet/src/freenet/crypt/DSAPublicKey.java > > > =================================================================== > > > --- trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 05:21:19 > > UTC (rev 18967) > > > +++ trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 05:25:41 > > UTC (rev 18968) > > > @@ -163,6 +163,13 @@ > > > return y.equals(o.y) && group.equals(o.group); > > > } > > > > > > + public int hashCode() { > > > + int hash = 5; > > > + hash = 61 * hash + (this.y != null ? this.y.hashCode() : 0); > > > + hash = 61 * hash + (this.group != null ? this.group.hashCode() : 0); > > > + return hash; > > > + } > > > > Arcane maths should really be justified in comments! Is this something you > > just made up or is there a reason for not just returning the xor of y and > > group's hash codes? Also, in what cases can they be null anyway? If they > > cease to be null, the hash code would change ... but aren't they final? > > I guess these are generated by IDE. > This is the standard pattern in the "Effective Java " book. It's all prime numbers... does it make the first few bits more dependant on y than on group? It looks like it, so I will change it to just xor them. > > > > + > > > public boolean equals(Object o) { > > > if(this == o) // Not necessary, but a very cheap optimization > > > return true; -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/c1dd71ec/attachment.pgp From toad at amphibian.dyndns.org Sat Apr 5 10:28:41 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Sat, 5 Apr 2008 11:28:41 +0100 Subject: [freenet-dev] =?utf-8?q?=5Bfreenet-cvs=5D_r18968_-=09trunk/freene?= =?utf-8?q?t/src/freenet/crypt?= In-Reply-To: <20080405031352.GC3710@freenetproject.org> References: <20080404052541.9AFE7479CE0@freenetproject.org> <200804041912.05250.toad@amphibian.dyndns.org> <20080405031352.GC3710@freenetproject.org> Message-ID: <200804051128.41760.toad@amphibian.dyndns.org> On Saturday 05 April 2008 04:13, Florent Daigni?re wrote: > * Matthew Toseland [2008-04-04 19:12:05]: > > > On Friday 04 April 2008 06:25, you wrote: > > > Author: nextgens > > > Date: 2008-04-04 05:25:41 +0000 (Fri, 04 Apr 2008) > > > New Revision: 18968 > > > > > > Modified: > > > trunk/freenet/src/freenet/crypt/DSAPublicKey.java > > > Log: > > > implement DSAPublicKey.hashCode() > > > > > > Modified: trunk/freenet/src/freenet/crypt/DSAPublicKey.java > > > =================================================================== > > > --- trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 05:21:19 > > UTC (rev 18967) > > > +++ trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 05:25:41 > > UTC (rev 18968) > > > @@ -163,6 +163,13 @@ > > > return y.equals(o.y) && group.equals(o.group); > > > } > > > > > > + public int hashCode() { > > > + int hash = 5; > > > + hash = 61 * hash + (this.y != null ? this.y.hashCode() : 0); > > > + hash = 61 * hash + (this.group != null ? this.group.hashCode() : 0); > > > + return hash; > > > + } > > > > Arcane maths should really be justified in comments! > > It's a standard pattern Does it provide equal influence for y and group on the first few bits of the hash code? Since I am not familiar with this particular pattern, it's your job to justify it! > > > Is this something you > > just made up or is there a reason for not just returning the xor of y and > > group's hash codes? > > I could have done that but I haven't :) > > > Also, in what cases can they be null anyway? If they > > cease to be null, the hash code would change ... but aren't they final? > > The spec says they can be null (in equals as well, fixed in r19001) What spec? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/9303438e/attachment.pgp From toad at amphibian.dyndns.org Sat Apr 5 10:44:39 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Sat, 5 Apr 2008 11:44:39 +0100 Subject: [freenet-dev] =?utf-8?q?=5Bfreenet-cvs=5D_r18966_-_in_trunk/freen?= =?utf-8?q?et/src/freenet=3A_crypt=09support_support/math?= In-Reply-To: <20080405023409.GD3487@freenetproject.org> References: <20080404052031.9FBFD479964@freenetproject.org> <200804041909.15519.toad@amphibian.dyndns.org> <20080405023409.GD3487@freenetproject.org> Message-ID: <200804051144.44692.toad@amphibian.dyndns.org> On Saturday 05 April 2008 03:34, Florent Daigni?re wrote: > * Matthew Toseland [2008-04-04 19:09:01]: > > > On Friday 04 April 2008 06:20, nextgens at freenetproject.org wrote: > > > Author: nextgens > > > Date: 2008-04-04 05:20:31 +0000 (Fri, 04 Apr 2008) > > > New Revision: 18966 > > > > > > Modified: > > > trunk/freenet/src/freenet/crypt/SHA1.java > > > trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java > > > trunk/freenet/src/freenet/support/math/DecayingKeyspaceAverage.java > > > trunk/freenet/src/freenet/support/math/RunningAverage.java > > > trunk/freenet/src/freenet/support/math/SimpleBinaryRunningAverage.java > > > Log: > > > implement Cloneable where we have a clone() method > > > > Why? > > > > public interface Cloneable > > > > A class implements the Cloneable interface to indicate to the Object.clone() > > method that it is legal for that method to make a field-for-field copy of > > instances of that class. > > > > Invoking Object's clone method on an instance that does not implement the > > Cloneable interface results in the exception CloneNotSupportedException being > > thrown. > > > > By convention, classes that implement this interface should override > > Object.clone (which is protected) with a public method. See Object.clone() > > for details on overriding this method. > > > > Note that this interface does not contain the clone method. Therefore, it is > > not possible to clone an object merely by virtue of the fact that it > > implements this interface. Even if the clone method is invoked reflectively, > > there is no guarantee that it will succeed. > > > > Okay, it's a bad idea in SHA1.java; I meant to do it in JavaSHA1.java > (r18972) and forgot to revert that bit afterwards... > > Fixed in r18998 > > I think that the patch is revelant for other classes. I don't. Cloneable does not even contain a public clone(). Its ONLY purpose is to indicate to the JVM that it can do a field for field copy. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/1136e53c/attachment.pgp From nextgens at freenetproject.org Sat Apr 5 11:22:26 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Sat, 5 Apr 2008 13:22:26 +0200 Subject: [freenet-dev] [freenet-cvs] r18975 -?trunk/freenet/src/freenet/client/async In-Reply-To: <200804051111.10896.toad@amphibian.dyndns.org> References: <20080404060554.A9A8F479DD4@freenetproject.org> <200804041922.28756.toad@amphibian.dyndns.org> <20080405025002.GB3710@freenetproject.org> <200804051111.10896.toad@amphibian.dyndns.org> Message-ID: <20080405112221.GF3710@freenetproject.org> * Matthew Toseland [2008-04-05 11:11:05]: > On Saturday 05 April 2008 03:50, Florent Daigni?re wrote: > > * Matthew Toseland [2008-04-04 19:22:27]: > > > > > On Friday 04 April 2008 07:05, nextgens at freenetproject.org wrote: > > > > Author: nextgens > > > > Date: 2008-04-04 06:05:54 +0000 (Fri, 04 Apr 2008) > > > > New Revision: 18975 > > > > > > > > Modified: > > > > trunk/freenet/src/freenet/client/async/SplitFileInserterSegment.java > > > > Log: > > > > Simplify a few things synchronization-wise declaring a few variables > > > volatile > > > > > > I thought there were issues with volatile? Like it's not deterministic, > and > > > you really should use locking in all nontrivial cases? > > > > I suggest you read > > http://www.javaperformancetuning.com/tips/volatile.shtml :) > > "Note however that volatile has been incompletely implemented in most JVMs. > Using volatile may not help to achieve the results you desire (yes this is a > JVM bug, but its been low priority until recently)." > > Presumably this doesn't include the mainline Sun VM. > > "NOTE THE TIP "volatile primitive datatypes have atomic ++ operations" HAS > BEEN SHOWN TO BE INVALID" > > So never use volatile integers/longs/shorts. That's not what it says... it only says that the ++ operator isn't atomic. As far as I know "++" is translated as x = x + 1 in bytecode (which isn't done in one operation) ... So it's obvious it's not atomic. > > Hmmm. > > > > Two things to add: > > 1) there is no significant performance cost for > > reading a volatile on x86 > > 2) The SplitFileInserterSegment class is already a synchronization > > nightmare so we'd better reduce the locking to the minimum there : we still > > had some unsynchronized accesses to those booleans. > > > > I think that making those booleans volatile is a step forward fighting > > the "requests don't finish" kind of bugs which are likely to be > > caused by race-conditions. > > > Have you seen complaints of splitfile *inserts* not finishing? AFAIK reports > are generally of requests not finishing... I've seen reports of FCP not reporting inserts completion, yes. Arguably not much recently but it's not like there was an active development of FCP apps going on... -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/e2d0aba1/attachment.pgp From nextgens at freenetproject.org Sat Apr 5 11:37:31 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Sat, 5 Apr 2008 13:37:31 +0200 Subject: [freenet-dev] [freenet-cvs] r18969 -?trunk/freenet/src/freenet/clients/http/bookmark In-Reply-To: <200804051122.53179.toad@amphibian.dyndns.org> References: <20080404052702.9AC47479D00@freenetproject.org> <200804041913.52722.toad@amphibian.dyndns.org> <20080405032206.GD3710@freenetproject.org> <200804051122.53179.toad@amphibian.dyndns.org> Message-ID: <20080405113729.GG3710@freenetproject.org> * Matthew Toseland [2008-04-05 11:22:48]: > On Saturday 05 April 2008 04:22, Florent Daigni?re wrote: > > * Matthew Toseland [2008-04-04 19:13:51]: > > > > > On Friday 04 April 2008 06:27, nextgens at freenetproject.org wrote: > > > > Author: nextgens > > > > Date: 2008-04-04 05:27:02 +0000 (Fri, 04 Apr 2008) > > > > New Revision: 18969 > > > > > > > > Modified: > > > > trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java > > > > Log: > > > > implement BookmarkItem.hashCode() > > > > > > Again, two points: > > > - This will change, and therefore break containing HashSet's etc, if the > parts > > > cease to be null. Are they all essential? If they are, are they final, and > > > can they be null? > > > > We must do the same checks as for equals()... If it breaks the code somehow > we should fix it. > > Of course, but I'm not sure we are doing this here: > - It is *NOT* necessary for hashCode to always return different values for > different objects. We can ignore elements with impunity. granted > - equals() is true if two BookmarkItem's have the same key and different > editions. So your code breaks equals/hashCode consistency. ok > - key and name cannot in any case be null. I'll dig up and see if I can find a reference here... but I'm almost sure the java spec says we should assume it can be. > > I've fixed the above. > > Also you haven't explained the mathematical voodoo... hashtables will > generally depend on the first few bits, which will in this case depend on the > description's hash followed by the alerts hash. Wouldn't it be better to > simply XOR all the parts together? > > In my implementation order matters with XORs it wouldn't. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/ab6447ef/attachment.pgp From nextgens at freenetproject.org Sat Apr 5 11:42:04 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Sat, 5 Apr 2008 13:42:04 +0200 Subject: [freenet-dev] [freenet-cvs] r18968 - trunk/freenet/src/freenet/crypt In-Reply-To: <200804051124.42888.toad@amphibian.dyndns.org> References: <20080404052541.9AFE7479CE0@freenetproject.org> <200804041912.05250.toad@amphibian.dyndns.org> <200804051124.42888.toad@amphibian.dyndns.org> Message-ID: <20080405114202.GH3710@freenetproject.org> * Matthew Toseland [2008-04-05 11:24:42]: > On Saturday 05 April 2008 01:12, Daniel Cheng wrote: > > On Sat, Apr 5, 2008 at 2:12 AM, Matthew Toseland > > wrote: > > > On Friday 04 April 2008 06:25, you wrote: > > > > Author: nextgens > > > > Date: 2008-04-04 05:25:41 +0000 (Fri, 04 Apr 2008) > > > > New Revision: 18968 > > > > > > > > Modified: > > > > trunk/freenet/src/freenet/crypt/DSAPublicKey.java > > > > Log: > > > > implement DSAPublicKey.hashCode() > > > > > > > > Modified: trunk/freenet/src/freenet/crypt/DSAPublicKey.java > > > > =================================================================== > > > > --- trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 > 05:21:19 > > > UTC (rev 18967) > > > > +++ trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 > 05:25:41 > > > UTC (rev 18968) > > > > @@ -163,6 +163,13 @@ > > > > return y.equals(o.y) && group.equals(o.group); > > > > } > > > > > > > > + public int hashCode() { > > > > + int hash = 5; > > > > + hash = 61 * hash + (this.y != null ? this.y.hashCode() : > 0); > > > > + hash = 61 * hash + (this.group != null ? > this.group.hashCode() : 0); > > > > + return hash; > > > > + } > > > > > > Arcane maths should really be justified in comments! Is this something you > > > just made up or is there a reason for not just returning the xor of y and > > > group's hash codes? Also, in what cases can they be null anyway? If they > > > cease to be null, the hash code would change ... but aren't they final? > > > > I guess these are generated by IDE. > > This is the standard pattern in the "Effective Java " book. > > It's all prime numbers... does it make the first few bits more dependant on y > than on group? It looks like it, so I will change it to just xor them. Yes and it's the point... You can change the order if you're not happy with the priority -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/4474d972/attachment.pgp From nextgens at freenetproject.org Sat Apr 5 11:48:01 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Sat, 5 Apr 2008 13:48:01 +0200 Subject: [freenet-dev] [freenet-cvs] r18968 -?trunk/freenet/src/freenet/crypt In-Reply-To: <200804051128.41760.toad@amphibian.dyndns.org> References: <20080404052541.9AFE7479CE0@freenetproject.org> <200804041912.05250.toad@amphibian.dyndns.org> <20080405031352.GC3710@freenetproject.org> <200804051128.41760.toad@amphibian.dyndns.org> Message-ID: <20080405114800.GI3710@freenetproject.org> * Matthew Toseland [2008-04-05 11:28:41]: > On Saturday 05 April 2008 04:13, Florent Daigni?re wrote: > > * Matthew Toseland [2008-04-04 19:12:05]: > > > > > On Friday 04 April 2008 06:25, you wrote: > > > > Author: nextgens > > > > Date: 2008-04-04 05:25:41 +0000 (Fri, 04 Apr 2008) > > > > New Revision: 18968 > > > > > > > > Modified: > > > > trunk/freenet/src/freenet/crypt/DSAPublicKey.java > > > > Log: > > > > implement DSAPublicKey.hashCode() > > > > > > > > Modified: trunk/freenet/src/freenet/crypt/DSAPublicKey.java > > > > =================================================================== > > > > --- trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 > 05:21:19 > > > UTC (rev 18967) > > > > +++ trunk/freenet/src/freenet/crypt/DSAPublicKey.java 2008-04-04 > 05:25:41 > > > UTC (rev 18968) > > > > @@ -163,6 +163,13 @@ > > > > return y.equals(o.y) && group.equals(o.group); > > > > } > > > > > > > > + public int hashCode() { > > > > + int hash = 5; > > > > + hash = 61 * hash + (this.y != null ? this.y.hashCode() : 0); > > > > + hash = 61 * hash + (this.group != null ? this.group.hashCode() : 0); > > > > + return hash; > > > > + } > > > > > > Arcane maths should really be justified in comments! > > > > It's a standard pattern > > Does it provide equal influence for y and group on the first few bits of the > hash code? Since I am not familiar with this particular pattern, it's your > job to justify it! No it's not equal in terms of influence and that's on purpose. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/0b92b8b9/attachment.pgp From toad at amphibian.dyndns.org Sat Apr 5 13:46:22 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Sat, 5 Apr 2008 14:46:22 +0100 Subject: [freenet-dev] [freenet-cvs] r19029 - trunk/freenet/src/freenet/store In-Reply-To: <20080405135400.34313479E5C@freenetproject.org> References: <20080405135400.34313479E5C@freenetproject.org> Message-ID: <200804051446.27227.toad@amphibian.dyndns.org> Sorry, forgot to mention this was a patch from Daniel Cheng as well. On Saturday 05 April 2008 14:54, toad at freenetproject.org wrote: > Author: toad > Date: 2008-04-05 13:53:59 +0000 (Sat, 05 Apr 2008) > New Revision: 19029 > > Modified: > trunk/freenet/src/freenet/store/RAMFreenetStore.java > Log: > RAMFreenetStore: Throw a KeyCollisionException if the data is different and !overwrite. > BDBFS already does this, so we are making RAMFS a better approximation to the deployed behaviour. > > Modified: trunk/freenet/src/freenet/store/RAMFreenetStore.java > =================================================================== > --- trunk/freenet/src/freenet/store/RAMFreenetStore.java 2008-04-05 13:51:28 UTC (rev 19028) > +++ trunk/freenet/src/freenet/store/RAMFreenetStore.java 2008-04-05 13:53:59 UTC (rev 19029) > @@ -90,6 +90,8 @@ > oldBlock.header = header; > if(storeFullKeys) > oldBlock.fullKey = fullKey; > + } else { > + throw new KeyCollisionException(); > } > return; > } else { > > _______________________________________________ > cvs mailing list > cvs at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080405/e95ee534/attachment.pgp From nextgens at freenetproject.org Sun Apr 6 07:56:24 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Sun, 6 Apr 2008 09:56:24 +0200 Subject: [freenet-dev] [freenet-cvs] r18966 - in trunk/freenet/src/freenet: crypt?support support/math In-Reply-To: <200804051144.44692.toad@amphibian.dyndns.org> References: <20080404052031.9FBFD479964@freenetproject.org> <200804041909.15519.toad@amphibian.dyndns.org> <20080405023409.GD3487@freenetproject.org> <200804051144.44692.toad@amphibian.dyndns.org> Message-ID: <20080406075622.GD3501@freenetproject.org> * Matthew Toseland [2008-04-05 11:44:39]: > On Saturday 05 April 2008 03:34, Florent Daigni?re wrote: > > * Matthew Toseland [2008-04-04 19:09:01]: > > > > > On Friday 04 April 2008 06:20, nextgens at freenetproject.org wrote: > > > > Author: nextgens > > > > Date: 2008-04-04 05:20:31 +0000 (Fri, 04 Apr 2008) > > > > New Revision: 18966 > > > > > > > > Modified: > > > > trunk/freenet/src/freenet/crypt/SHA1.java > > > > trunk/freenet/src/freenet/support/DoublyLinkedListImpl.java > > > > trunk/freenet/src/freenet/support/math/DecayingKeyspaceAverage.java > > > > trunk/freenet/src/freenet/support/math/RunningAverage.java > > > > > trunk/freenet/src/freenet/support/math/SimpleBinaryRunningAverage.java > > > > Log: > > > > implement Cloneable where we have a clone() method > > > > > > Why? > > > > > > public interface Cloneable > > > > > > A class implements the Cloneable interface to indicate to the > Object.clone() > > > method that it is legal for that method to make a field-for-field copy of > > > instances of that class. > > > > > > Invoking Object's clone method on an instance that does not implement the > > > Cloneable interface results in the exception CloneNotSupportedException > being > > > thrown. > > > > > > By convention, classes that implement this interface should override > > > Object.clone (which is protected) with a public method. See Object.clone() > > > for details on overriding this method. > > > > > > Note that this interface does not contain the clone method. Therefore, it > is > > > not possible to clone an object merely by virtue of the fact that it > > > implements this interface. Even if the clone method is invoked > reflectively, > > > there is no guarantee that it will succeed. > > > > > > > Okay, it's a bad idea in SHA1.java; I meant to do it in JavaSHA1.java > > (r18972) and forgot to revert that bit afterwards... > > > > Fixed in r18998 > > > > I think that the patch is revelant for other classes. > > I don't. Cloneable does not even contain a public clone(). Its ONLY purpose is > to indicate to the JVM that it can do a field for field copy. Ok, reverted in r19052 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080406/0e2b7f9a/attachment.pgp From ian.clarke at gmail.com Sun Apr 6 12:57:46 2008 From: ian.clarke at gmail.com (Ian Clarke) Date: Sun, 6 Apr 2008 07:57:46 -0500 Subject: [freenet-dev] Installation bugs on a Mac, and some usability issues Message-ID: <823242bd0804060557u4dcaaba3k3ed21135547da0a3@mail.gmail.com> Just installed using the webstart installer. Set the installation path to /Users/ian/Applications/Freenet. Click "Yes" after the "The directory already exists" warning. See the bars go by on the "Overall installation progress", it says its finished. Hit next. Now surprised to see that actually there seems to be more installation that needs doing, since the previous Wizard step kinda implied that installation is finished. I'm wondering if we could make all of this console output part of the previous wizard step hidden behind a nice progress bar? Anyway, it works its way down, gets to: ...Freenet/bin/install_startup_hook-mac.sh: line 35: /Library/StartupItems//Freenet/Freenet.plist: No such file or directory It actually produces 6 or 7 similar lines of output, and before that its complaining about not being able to find Freenet.sh in the same directory. I'm wondering why its trying to install a startup item without asking my permission (at least I don't remember it asking my permission), and how it plans to do it when I haven't entered my administrator password (something that normally pops up at the start of an installation if its needed). Its around this time I get a "Process execution failed" dialog box. I hit "Ok", it does some other stuff, and says "All done, please click Next", oh and throws up this dialog box: Java.io.IOException : /Users/ian/Applications/Freenet/bin/cleanup.sh: not found On the installation wizard, I click "No, I want the node to automatically find strangers to connect to", hit "Continue", and I get a "HTTP Method not allowed" error. I hit "back" a few times, try it again, and it works. I haven't been able to reproduce the "HTTP Method not allowed" bug. We definitely need to try and get the installer cleaned up before RC2, hopefully this feedback will help. Ian. -- Email: ian at uprizer.com Cell: +1 512 422 3588 Skype: sanity From nextgens at freenetproject.org Sun Apr 6 14:22:41 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Sun, 6 Apr 2008 16:22:41 +0200 Subject: [freenet-dev] Installation bugs on a Mac, and some usability issues In-Reply-To: <823242bd0804060557u4dcaaba3k3ed21135547da0a3@mail.gmail.com> References: <823242bd0804060557u4dcaaba3k3ed21135547da0a3@mail.gmail.com> Message-ID: <20080406142238.GG3501@freenetproject.org> * Ian Clarke [2008-04-06 07:57:46]: > Just installed using the webstart installer. Set the installation > path to /Users/ian/Applications/Freenet. Click "Yes" after the "The > directory already exists" warning. > > See the bars go by on the "Overall installation progress", it says its > finished. Hit next. > > Now surprised to see that actually there seems to be more installation > that needs doing, since the previous Wizard step kinda implied that > installation is finished. I'm wondering if we could make all of this > console output part of the previous wizard step hidden behind a nice > progress bar? > Not easily; No way it can be done before -rc2 > Anyway, it works its way down, gets to: > > ...Freenet/bin/install_startup_hook-mac.sh: line 35: > /Library/StartupItems//Freenet/Freenet.plist: No such file or > directory > > It actually produces 6 or 7 similar lines of output, and before that > its complaining about not being able to find Freenet.sh in the same > directory. > Allright I will fix this one > I'm wondering why its trying to install a startup item without asking > my permission (at least I don't remember it asking my permission), and > how it plans to do it when I haven't entered my administrator password > (something that normally pops up at the start of an installation if > its needed). > As we don't ask for it on windows, I don't see any reason why we should ask for it on macos... I don't think we need administrator rights to make it auto-startup, isn't /Library/LaunchDaemons/ writable for everyone ? > Its around this time I get a "Process execution failed" dialog box. I > hit "Ok", it does some other stuff, and says "All done, please click > Next", oh and throws up this dialog box: > > Java.io.IOException : /Users/ian/Applications/Freenet/bin/cleanup.sh: not found > I bet this one is because of the previous errors > On the installation wizard, I click "No, I want the node to > automatically find strangers to connect to", hit "Continue", and I get > a "HTTP Method not allowed" error. I hit "back" a few times, try it > again, and it works. I haven't been able to reproduce the "HTTP > Method not allowed" bug. > This particular bug has been fixed in trunk; the fix will be deployed with next build. > We definitely need to try and get the installer cleaned up before RC2, > hopefully this feedback will help. It does help :) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080406/eab6b495/attachment.pgp From bbackde at googlemail.com Sun Apr 6 16:07:01 2008 From: bbackde at googlemail.com (bbackde at googlemail.com) Date: Sun, 6 Apr 2008 18:07:01 +0200 Subject: [freenet-dev] Frontpage layout Message-ID: On the node homepage, the bookmarks are below the omnipresent opennet warning. Below the bookmarks I can find the more important boxes for current activity, fetch freesite links and the node version. My bookmarks are long, and I often have to scroll down to the bottom of the page to access the other elements. This is annoying. Can you please either 1 - move the bookmarks down to the bottom of the page 2 - put them to a new dedicated bookmarks page 3 - or at least compact them and use the width of the wide screens used today? I prefer 2 together with 3 :) Thanks! From sven-ola at gmx.de Sun Apr 6 20:50:13 2008 From: sven-ola at gmx.de (Sven-Ola =?iso-8859-1?q?T=FCcke?=) Date: Sun, 6 Apr 2008 22:50:13 +0200 Subject: [freenet-dev] Embedded build In-Reply-To: <200804041430.44615.sven-ola@gmx.de> References: <200804040832.24363.sven-ola@gmx.de> <200804041430.44615.sven-ola@gmx.de> Message-ID: <200804062250.13596.sven-ola@gmx.de> Hi, detected a couple of unused bytes in libgcj. Initial memory consumption now ~38Mb down to ~28 Mb. Telnet iface runs. Frost runs (to some extent). Changed my numbering scheme, so *.tgz now numbered to reflect the SVN revision. I got occasional oopses. Are those normal? Caught in PacketSender: java.lang.NullPointerException java.lang.NullPointerException at java.util.Hashtable.hash(freenet-static-i486-linux-gnu) at java.util.Hashtable.get(freenet-static-i486-linux-gnu) at freenet.node.LocationManager.lostOrRestartedNode(freenet-static-i486-linux-gnu) at freenet.node.PeerNode.disconnected(freenet-static-i486-linux-gnu) at freenet.node.PacketSender.realRun(freenet-static-i486-linux-gnu) at freenet.node.PacketSender.run(freenet-static-i486-linux-gnu) at java.lang.Thread.run(freenet-static-i486-linux-gnu) at freenet.support.io.NativeThread.run(freenet-static-i486-linux-gnu) As ususal, uploaded to: http://download-master.berlin.freifunk.net/sven-ola/ as a reminder: you need to start manually after untarring, e.g. export LD_LIBRARY_PATH=lib ./freenet-static-i486-linux-gnu -mx=48M -ms=48M // Sven-Ola [tofu removed] From nextgens at freenetproject.org Mon Apr 7 00:16:46 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Mon, 7 Apr 2008 02:16:46 +0200 Subject: [freenet-dev] Frontpage layout In-Reply-To: References: Message-ID: <20080407001644.GA3675@freenetproject.org> * bbackde at googlemail.com [2008-04-06 18:07:01]: > On the node homepage, the bookmarks are below the omnipresent opennet warning. > > Below the bookmarks I can find the more important boxes for current > activity, fetch freesite links and the node version. > My bookmarks are long, and I often have to scroll down to the bottom > of the page to access the other elements. > This is annoying. > > Can you please either > 1 - move the bookmarks down to the bottom of the page > 2 - put them to a new dedicated bookmarks page > 3 - or at least compact them and use the width of the wide screens used today? > > I prefer 2 together with 3 :) > > Thanks! You can change the ordering of the boxes (and even hide the one about opennet if it bothers you that much) with a new CSS layer. If you use fproxy.CSSOverride you don't even need your CSS sheet to be bundled with the node. Anyway, let me remind you what the procedure to submit feature requests is : First step is to write a new kicking-ass CSS sheet, the second is to submit it on the bug tracker as a feature request with a patch so that it can be bundled and distributed mainstream ... and only then mail @devl to discuss about what the default layout should be. If you don't want to write it yourself it's probably that it doesn't bother you that much; fine, submit a ticket on the bug tracker then. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080407/2c0bbd3c/attachment.pgp From robert at freenetproject.org Mon Apr 7 16:00:32 2008 From: robert at freenetproject.org (Robert Hailey) Date: Mon, 7 Apr 2008 11:00:32 -0500 Subject: [freenet-dev] r19014 - trunk/freenet/src/freenet/node In-Reply-To: <20080405131853.E1264479A7C@freenetproject.org> References: <20080405131853.E1264479A7C@freenetproject.org> Message-ID: <540A8D54-C893-40C0-8093-73978B826C16@freenetproject.org> On Apr 5, 2008, at 8:18 AM, toad at freenetproject.org wrote: > Author: toad > Date: 2008-04-05 13:18:53 +0000 (Sat, 05 Apr 2008) > New Revision: 19014 > > Modified: > trunk/freenet/src/freenet/node/SSKInsertSender.java > Log: > Synchronize on access to status. > Inspired by Daniel Cheng's patch. > > Modified: trunk/freenet/src/freenet/node/SSKInsertSender.java > =================================================================== > --- trunk/freenet/src/freenet/node/SSKInsertSender.java 2008-04-05 > 13:16:17 UTC (rev 19013) > +++ trunk/freenet/src/freenet/node/SSKInsertSender.java 2008-04-05 > 13:18:53 UTC (rev 19014) > @@ -525,7 +525,7 @@ > // Nothing to wait for, no downstream transfers, just exit. > } > > - public int getStatus() { > + public synchronized int getStatus() { > return status; > } > > @@ -536,7 +536,7 @@ > /** > * @return The current status as a string > */ > - public String getStatusString() { > + public synchronized String getStatusString() { > if(status == SUCCESS) > return "SUCCESS"; > if(status == ROUTE_NOT_FOUND) > I have not really examined nextgens recent volatile patches, but my understanding is that this is actually one of the limited cases where a volatile field is exactly what is desired. Other threads (like fproxy, logging) would have to block to read the status, but the synchronization does not help since the moment the status is returned any atomicity is lost. The return value of getStatus()/ getStatusString() is therefore inherently 'dirty'. Consider the following patch. -- Robert Hailey Index: src/freenet/node/SSKInsertSender.java =================================================================== --- src/freenet/node/SSKInsertSender.java (revision 19061) +++ src/freenet/node/SSKInsertSender.java (working copy) @@ -59,7 +59,7 @@ private SSKBlock block; private static boolean logMINOR; - private int status = -1; + private volatile int status = -1; /** Still running */ static final int NOT_FINISHED = -1; /** Successful insert */ @@ -525,7 +525,7 @@ // Nothing to wait for, no downstream transfers, just exit. } - public synchronized int getStatus() { + public int getStatus() { return status; } @@ -536,7 +536,10 @@ /** * @return The current status as a string */ - public synchronized String getStatusString() { + public String getStatusString() { + //status is volatile, get a value only once. + int status=this.status; + if(status == SUCCESS) return "SUCCESS"; if(status == ROUTE_NOT_FOUND) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://emu.freenetproject.org/pipermail/devl/attachments/20080407/76e2983c/attachment.htm From nextgens at freenetproject.org Tue Apr 8 02:13:00 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Tue, 8 Apr 2008 04:13:00 +0200 Subject: [freenet-dev] r19014 - trunk/freenet/src/freenet/node In-Reply-To: <540A8D54-C893-40C0-8093-73978B826C16@freenetproject.org> References: <20080405131853.E1264479A7C@freenetproject.org> <540A8D54-C893-40C0-8093-73978B826C16@freenetproject.org> Message-ID: <20080408021259.GB3516@freenetproject.org> * Robert Hailey [2008-04-07 11:00:32]: > > On Apr 5, 2008, at 8:18 AM, toad at freenetproject.org wrote: > >> Author: toad >> Date: 2008-04-05 13:18:53 +0000 (Sat, 05 Apr 2008) >> New Revision: 19014 >> >> Modified: >> trunk/freenet/src/freenet/node/SSKInsertSender.java >> Log: >> Synchronize on access to status. >> Inspired by Daniel Cheng's patch. >> >> Modified: trunk/freenet/src/freenet/node/SSKInsertSender.java >> =================================================================== >> --- trunk/freenet/src/freenet/node/SSKInsertSender.java 2008-04-05 >> 13:16:17 UTC (rev 19013) >> +++ trunk/freenet/src/freenet/node/SSKInsertSender.java 2008-04-05 >> 13:18:53 UTC (rev 19014) >> @@ -525,7 +525,7 @@ >> // Nothing to wait for, no downstream transfers, just exit. >> } >> >> - public int getStatus() { >> + public synchronized int getStatus() { >> return status; >> } >> >> @@ -536,7 +536,7 @@ >> /** >> * @return The current status as a string >> */ >> - public String getStatusString() { >> + public synchronized String getStatusString() { >> if(status == SUCCESS) >> return "SUCCESS"; >> if(status == ROUTE_NOT_FOUND) >> > > I have not really examined nextgens recent volatile patches, but my > understanding is that this is actually one of the limited cases where a > volatile field is exactly what is desired. Other threads (like fproxy, > logging) would have to block to read the status, but the synchronization > does not help since the moment the status is returned any atomicity is > lost. The return value of getStatus()/getStatusString() is therefore > inherently 'dirty'. > Agreed, synchronization is not necessary here -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080408/19a6db6d/attachment.pgp From toad at amphibian.dyndns.org Tue Apr 8 12:06:24 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Tue, 8 Apr 2008 13:06:24 +0100 Subject: [freenet-dev] Frontpage layout In-Reply-To: References: Message-ID: <200804081306.25127.toad@amphibian.dyndns.org> On Sunday 06 April 2008 17:07, bbackde at googlemail.com wrote: > On the node homepage, the bookmarks are below the omnipresent opennet warning. > > Below the bookmarks I can find the more important boxes for current > activity, fetch freesite links and the node version. None of these is important to an average user. "Fetch freesite" takes a key, a new user has no idea what one is (and will assume it's a search box), and an experienced user will just append it to http://127.0.0.1:8888/ . > My bookmarks are long, and I often have to scroll down to the bottom > of the page to access the other elements. > This is annoying. > > Can you please either > 1 - move the bookmarks down to the bottom of the page > 2 - put them to a new dedicated bookmarks page > 3 - or at least compact them and use the width of the wide screens used today? > > I prefer 2 together with 3 :) > > Thanks! > _______________________________________________ > Devl mailing list > Devl at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080408/952097e7/attachment.pgp From nextgens at freenetproject.org Tue Apr 8 15:54:42 2008 From: nextgens at freenetproject.org (Florent =?iso-8859-1?Q?Daigni=E8re?=) Date: Tue, 8 Apr 2008 17:54:42 +0200 Subject: [freenet-dev] Embedded build In-Reply-To: <200804062250.13596.sven-ola@gmx.de> References: <200804040832.24363.sven-ola@gmx.de> <200804041430.44615.sven-ola@gmx.de> <200804062250.13596.sven-ola@gmx.de> Message-ID: <20080408155440.GB3569@freenetproject.org> * Sven-Ola T?cke [2008-04-06 22:50:13]: > Hi, > > detected a couple of unused bytes in libgcj. Initial memory consumption now > ~38Mb down to ~28 Mb. Telnet iface runs. Frost runs (to some extent). Changed my > numbering scheme, so *.tgz now numbered to reflect the SVN revision. > > I got occasional oopses. Are those normal? No they aren't normal... They are probably a jvm bug though, otherwise we would get them too. Any chance you can get associated line-numbers in the trace ? :p Is a core file generated, can you load it in gdb and see where the problem is ? > > Caught in PacketSender: java.lang.NullPointerException > java.lang.NullPointerException > at java.util.Hashtable.hash(freenet-static-i486-linux-gnu) > at java.util.Hashtable.get(freenet-static-i486-linux-gnu) > at freenet.node.LocationManager.lostOrRestartedNode(freenet-static-i486-linux-gnu) > at freenet.node.PeerNode.disconnected(freenet-static-i486-linux-gnu) > at freenet.node.PacketSender.realRun(freenet-static-i486-linux-gnu) > at freenet.node.PacketSender.run(freenet-static-i486-linux-gnu) > at java.lang.Thread.run(freenet-static-i486-linux-gnu) > at freenet.support.io.NativeThread.run(freenet-static-i486-linux-gnu) > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://emu.freenetproject.org/pipermail/devl/attachments/20080408/3d0f1eb8/attachment.pgp From robert at freenetproject.org Tue Apr 8 18:38:14 2008 From: robert at freenetproject.org (Robert Hailey) Date: Tue, 8 Apr 2008 13:38:14 -0500 Subject: [freenet-dev] r19072 - trunk/freenet/src/freenet/client In-Reply-To: <20080408141901.3ECE1479CF5@freenetproject.org> References: <20080408141901.3ECE1479CF5@freenetproject.org> Message-ID: <0CD93F59-5FAE-4754-9819-002C5A3D142E@freenetproject.org> On Apr 8, 2008, at 9:19 AM, toad at freenetproject.org wrote: > Author: toad > Date: 2008-04-08 14:19:00 +0000 (Tue, 08 Apr 2008) > New Revision: 19072 > > Modified: > trunk/freenet/src/freenet/client/FECCodec.java > Log: > Increase redundancy from 128 -> 192 to 128 -> 255. > This will increase the cost of an upload by 33%, but inserts are > pretty fast right now. > We expect it to increase reliability significantly. Redundancy at > the FEC level is far more efficient than redundancy at the simple > block duplication level. > To help when blocks are dropped out... right... I know this has probably already been discussed and rejected, but would it be feasible to add a boolean flag to blocks (to be stored) to indicate if it is a short-term block or long-term? It seems like there are at least two types of traffic: short-term (messages, file transfers, etc) which become irrelevant shortly after posting, and long-term (like freesites, big files, etc) which are intended to be stored as long as possible. But I guess that's if they are naturally decaying... Is this more to do with natural decay, network churn (blocks actually being removed from the network), or nodes just changing location? Maybe inserts need to be stored on more nodes' stores (than present 2-3), meaning that the caches (20) do not suffice? -- Robert Hailey From toad at amphibian.dyndns.org Tue Apr 8 19:00:17 2008 From: toad at amphibian.dyndns.org (Matthew Toseland) Date: Tue, 8 Apr 2008 20:00:17 +0100 Subject: [freenet-dev] r19072 - trunk/freenet/src/freenet/client In-Reply-To: <0CD93F59-5FAE-4754-9819-002C5A3D142E@freenetproject.org> References: <20080408141901.3ECE1479CF5@freenetproject.org> <0CD93F59-5FAE-4754-9819-002C5A3D142E@freenetproject.org> Message-ID: <200804082000.18467.toad@amphibian.dyndns.org> On Tuesday 08 April 2008 19:38, Robert Hailey wrote: > > On Apr 8, 2008, at 9:19 AM, toad at freenetproject.org wrote: > > > Author: toad > > Date: 2008-04-08 14:19:00 +0000 (Tue, 08 Apr 2008) > > New Revision: 19072 > > > > Modified: > > trunk/freenet/src/freenet/client/FECCodec.java > > Log: > > Increase redundancy from 128 -> 192 to 128 -> 255. > > This will increase the cost of an upload by 33%, but inserts are > > pretty fast right now. > > We expect it to increase reliability significantly. Redundancy at > > the FEC level is far more efficient than redundancy at the simple > > block duplication level. > > To help when blocks are dropped out... right... > > I know this has probably already been discussed and rejected, but > would it be feasible to add a boolean flag to blocks (to be stored) to > indicate if it is a short-term block or long-term? It seems like there > are at least two types of traffic: short-term (messages, file > transfers, etc) which become irrelevant shortly after posting, and > long-term (like freesites, big files, etc) which are intended to be > stored as long as possible. But I guess that's if they are naturally > decaying... Most of the short-term traffic is Frost spam, which is just SSKs, because it's cheaper to insert SSKs pointing to random CHKs that already exist... If it wasn't for the spam, it would be equal numbers of SSKs and CHKs, assuming a typical message can't fit in 1kB (or has a MIME type). I don't think short term traffic is that big a part of the total though. Stats would be welcome of course. Also any sort of preference system will be abused by clients to prioritise their data over everyone else's, and by attackers as an extra bit of information to identify what the data is. > > Is this more to do with nat