zerovm / zerocloud

Swift middleware for Zerocloud
Apache License 2.0
53 stars 14 forks source link

Fix a caching issue with SwiftPath object #163

Closed larsbutler closed 9 years ago

larsbutler commented 9 years ago

Fixes https://github.com/zerovm/zerocloud/issues/162.

By default, Swift uses JSON encoding for caching objects in memcached.

A recent bug fix (d4d088a2932406d925c5ff304eb8835678273351) made the assumption that cached objects were pickleable. All of the tests passed, but I observed this break in production. See https://github.com/zerovm/zerocloud/issues/162 for details about the error I observed.

In general, pickling should not be used for caching objects. There is a reference to this in Swift commit e1ff51c04554d51616d2845f92ab726cb0e5831a.

This patch switches to using JSON encoding for storing SwiftPath objects in memcached.