Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala Common Enrich: bump commons codec to 1.10 #2691

Closed
fblundun opened this issue May 26, 2016 · 5 comments
Closed

Scala Common Enrich: bump commons codec to 1.10 #2691

fblundun opened this issue May 26, 2016 · 5 comments
Assignees

Comments

@fblundun
Copy link
Contributor

[info] DecodeBase64UrlSpec
[info] 
[info] This is a specification to test the decodeBase64Url function
[info] 
[info] + decodeBase64Url should return failure if passed a null
[info] x decodeBase64Url should not return failure on any other string
[error]  A counter-example is '돢겻' (after 4 tries)
[error]  'Failure(Field [e]: exception Base64-decoding [돢겻] (URL-safe encoding): [null])' is not Success (conversionUtilsSpecs.scala:124)
[info] 
[info] + decodeBase64Url should correctly decode valid Base64 (URL-safe) encoded strings
[info] 
[info] Total for specification DecodeBase64UrlSpec
[info] Finished in 2 ms
[info] 3 examples, 1 failure, 0 error

As seen in this Travis build.

@fblundun
Copy link
Contributor Author

Looks like this is the failing test

@fblundun
Copy link
Contributor Author

Oddly, when I call the function on "돢겻" in the sbt console it doesn't fail:

scala> ConversionUtils.decodeBase64Url("e","돢겻")
res5: scalaz.Validation[String,String] = Success()

maybe copy-and-pasting the characters involved changing their encoding or something.

@fblundun
Copy link
Contributor Author

@fblundun fblundun changed the title Scala Common Enrich: decodeBase64Url spec sometimes fails Scala Common Enrich: bump commons codec to 1.10 Jun 3, 2016
@fblundun
Copy link
Contributor Author

fblundun commented Jun 3, 2016

The Base64 class in commons-codec 1.5 is not thread-safe. This can cause corruption in the test suite (when tests are run in parallel) and in Stream Enrich (when multiple KCL threads simultaneously access an instance of the class).

The problematic instance

@fblundun
Copy link
Contributor Author

fblundun commented Jun 3, 2016

The bug in the base 64 library: https://issues.apache.org/jira/browse/CODEC-96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant