Skip to content

Wrap DateFormat in a thread local instance.#494

Merged
f2prateek merged 1 commit intodevfrom
fix-date-format
Jan 26, 2017
Merged

Wrap DateFormat in a thread local instance.#494
f2prateek merged 1 commit intodevfrom
fix-date-format

Conversation

@f2prateek
Copy link
Copy Markdown
Contributor

@f2prateek f2prateek commented Jan 26, 2017

From the docs:

https://developer.android.com/reference/java/text/SimpleDateFormat.html

Date formats are not synchronized. It is recommended to create
separate format instances for each thread. If multiple threads access
a format concurrently, it must be synchronized externally.

This is likely causing us to send invalid timestamps, as seen in some s3 buckets, e.g. 2016-12-23T00:0017:40+1300 and 2017-1-05T16:44:34+0800.

From the docs:

https://developer.android.com/reference/java/text/SimpleDateFormat.html

```
Date formats are not synchronized. It is recommended to create
separate format instances for each thread. If multiple threads access
a format concurrently, it must be synchronized externally.
```

This is causing us to send timestamps, such as:
`2016-12-23T00:0017:40+1300`, `2017-1-05T16:44:34+0800`
@f2prateek f2prateek merged commit 8edca47 into dev Jan 26, 2017
@f2prateek f2prateek deleted the fix-date-format branch January 26, 2017 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant