An In-Memory CSS Compressor For django-pipeline

I recently discovered the convenience of the django-pipeline library when attempting to reduce the asset size of a Django project. Currently, this library only seems to support external CSS compressors, such as Yuglify and YUI. While I have no objection to these specific tools, I simply do not want to ...

Disable Artifact Archiving With Jenkins DSL

Out of the box, the Jenkins DSL project doesn't currently provide a way of disabling artifact archiving. For projects with large outputs built on slave nodes, this can cause dramatic slowdowns as gigabytes of data are sent back to the master. Luckily, the configure block can be used to ...

Freeing MappedByteBuffer

While investigating a production bug that indicated that the operating system of a server running only a JVM continually ran out of memory under a specific set of circumstances, I discovered a very interesting idiosyncrasy of the JVM. Specifically, memory allocated with mmap through the MappedByteBuffer (the super class of ...

The Cost Of Consistency: When 9ms Is 1s Too Much

The CAP theorem remains one of the most important tools in my software developer's toolbelt. Used correctly, it can help create services and products that can offer an excellent user experience and protect revenue during partial failures. Used incorrectly, it can lead to a poor user experience and loss ...

Pessimistic Optimism: The Case Of Unexpected Deadlocks

Despite the fact I've been developing software in one way or another for almost 20 years, I'm constantly surprised how things work, and, once the frustration wears off, I'm intrigued when things break. Lucky for me, over the last few weeks, I've been surprised, frustrated, and ...

Dropwizard IT Port Randomisation

Dropwizard's testing package includes a @ClassRule, DropwizardAppRule, that may be used to create end-to-end integration tests. However, you may rapidly discover that parallel test execution is severely impaired, as each test attempts to use the same application and admin ports as another. You can get around this by changing ...

Retain Your CDI Qualifiers

The CDI specifications is very clear in its definition of qualifiers:

A qualifier type is a Java annotation defined as @Target({METHOD, FIELD, PARAMETER, TYPE}) and @Retention(RUNTIME).

Of particular importance is the @Retention information: with the default retention, CLASS, a container's behaviour is undefined. I discovered this critical ...

Perceiving The Effects Of Cache Coherency In Spin Locks

The "test-and-test-and-set" algorithm is a fairly well-understood solution to reducing latency in spin locks. In particular, the algorithm is often employed to reduce the latency exhibited in the similar "test-and-set" algorithm. Understanding how and why a seeming-superfluous read results in lower latency is rather interesting.

An astute reader may point ...

Downcasting Longs To Ints On x86

Last week, my esteemed colleague and close friend asked a remarkably straight-forward question about downcasting a long to an int in Java. I'll admit the question caught me off guard. While the JLS offered the correct answer, I couldn't help but ponder what's actually happening in the ...

Finally, Rollback Your Transaction

Lately, I've been working with code that exhibits a fairly poor practice: programmatic transactions (namely Spring) don't always get committed or rolled-back, even though the code appears correct. Consider the following contrived scenario:

void doWork(final PlatformTransactionManager txm)
{
    final TransactionStatus tx = txm.getTransaction(new DefaultTransactionDefinition());
    try {
        // do some ...

1 2 3