Updateing apache tar streams

10 views
Skip to first unread message

Olaf Lenz

unread,
Mar 24, 2015, 7:28:17 AM3/24/15
to jenkin...@googlegroups.com
Hi!

My name is Olaf Lenz, I'm a software engineer from Germany. Although I have already made some (small) contributions to various plugins, I have not yet any experience with Jenkins core development.
What I want to do is to fix the following issue: https://issues.jenkins-ci.org/browse/JENKINS-10629 

At first, I would try to update the Tar{Input,Output}Stream to a recent version, as suggested by Daniel Beck. If that doesn't solve the issue (from looking at the code changes I don't think it does), I will see what needs to be done.

The "Contributing to Jenkins"-page tells me that I should provide a unit test for the modification. However, as this is about files >8GB, and sending these via stream is pretty costly, I am not sure whether it is a good idea to make this unit test part of the standard test suite. Are there any suggestions from the experienced developers?

Olaf

Daniel Beck

unread,
Mar 24, 2015, 7:39:39 AM3/24/15
to jenkin...@googlegroups.com
FWIW I have this fixed locally. Just get rid of the copies of the TarInput/OutputStreams in hudson.org.apache.tools.tar, update Ant in pom.xml from 1.8.3 to 1.9.4, and change the import in TarArchiver. No need for a patched implementation anymore AFAICT. I just haven't published this yet because I have no idea what possible regressions might be.

That said, a test in the acceptance test harness may be suitable. It wouldn't be the first test of this kind, the one for Compress Artifacts Plugin creates a workspace of >4GB and zips it.

https://github.com/jenkinsci/acceptance-test-harness/blob/master/src/test/java/plugins/CompressArtifactsPluginTest.java#L89
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/84dab44f-e3ed-4c66-a9b1-0cd68a4c2db9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Olaf Lenz

unread,
Mar 24, 2015, 8:02:34 AM3/24/15
to jenkin...@googlegroups.com, m...@beckweb.net
You mean you are unsure about the regressions of updating ant to 1.9.4, or do you see other possible regressions?

Daniel Beck

unread,
Mar 24, 2015, 8:14:27 AM3/24/15
to jenkin...@googlegroups.com

> You mean you are unsure about the regressions of updating ant to 1.9.4, or do you see other possible regressions?

Yes, both in the changed Tar…Streams and the rest of Ant as used by Jenkins. Updating Ant seemed like the way to go and IIRC there's also a bunch of other classes added since we copied the classes over that are needed by the Streams. However I haven't investigated any further.

I haven't looked further for possible problems, or performed extensive tests with the patched build. So this could work without any problems.

Olaf Lenz

unread,
Mar 26, 2015, 5:40:06 AM3/26/15
to jenkin...@googlegroups.com
After I have managed to set up my environment for Jenkins development, I started to implement a test case for the problem in test/hudson/tasks/ArtifactArchiverTest.java. I have attached the file. The test seems to work fine, but I am unhappy with some details. Maybe you have some hints for me?

  1. The test runs very long. This is not very surprising, as it first has to generate a 8GB file, then copy it, and finally check it. However, I think some speedup should be possible when generating the file. My idea was to generate a large file with arbitrary data and to only put in some generated data for comparison at the files very end. To quickly generate such a file, the recommended way is to create a RandomAccessFile with the wanted size, then seek to the required position and write the data there. However, in the test, I only have the "FilePath" of the file available, which doesn't allow me to do so. I tried to use FilePath.act (as you can see in the commented out code), but to no effect. What am I doing wrong?
  2. Also, it would be a good idea to check whether there is enough space left on the device to store the large file twice before actually executing the test at all. How can I do that? I didn't find any hint on that.
  3. I'm using eclipse as an IDE. I tried to execute the tests as Junit tests, but that fails due to some markers in the whole project (69 errors), so that it doesn't start the unit test. Are there any tricks to get rid of these problems, or to starte the junit tests anyway? Is eclipse still used by Jenkins devels, or is another IDE preferred?
Olaf


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/QmTnfDlMWpE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/B2FA3874-49D9-49FA-8468-86B5BDA236E5%40beckweb.net.
ArtifactArchiverTest.java
Reply all
Reply to author
Forward
0 new messages