calculatePeriods method changes default timezone and is not thread-safe

Steps to reproduce

See for description. calculatePeriods updates the JVM timezone temporarily, which can affect other threads executing concurrently that rely on the default timezone to be correct.

implemented a workaround which prevents the server from permanently being set to the wrong timezone.

This issue is for a proper solution.

Activity

Show:
Stephen Marquard
March 16, 2018, 7:10 AM

opencast→ opencast.git ((HEAD detached at origin/r/4.x)) ☘ modules/# grep -r TimeZone.setDefault /src/
matterhorn-index-service/src/test/java/org/opencastproject/index/service/impl/IndexServiceImplTest.java: TimeZone.setDefault(cet);
matterhorn-index-service/src/test/java/org/opencastproject/index/service/impl/IndexServiceImplTest.java: TimeZone.setDefault(cet);
matterhorn-index-service/src/test/java/org/opencastproject/index/service/impl/IndexServiceImplTest.java: TimeZone.setDefault(tz);
matterhorn-index-service/src/test/java/org/opencastproject/index/service/impl/IndexServiceImplTest.java: TimeZone.setDefault(utc);
matterhorn-index-service/src/test/java/org/opencastproject/index/service/impl/IndexServiceImplTest.java: TimeZone.setDefault(timeZone);
matterhorn-index-service/src/test/java/org/opencastproject/index/service/impl/IndexServiceImplTest.java: TimeZone.setDefault(utc);
matterhorn-index-service/src/test/java/org/opencastproject/index/service/impl/IndexServiceImplTest.java: TimeZone.setDefault(timeZone);
matterhorn-scheduler-api/src/main/java/org/opencastproject/scheduler/api/Util.java: TimeZone.setDefault(tz);
matterhorn-scheduler-api/src/main/java/org/opencastproject/scheduler/api/Util.java: TimeZone.setDefault(utc);
matterhorn-scheduler-api/src/main/java/org/opencastproject/scheduler/api/Util.java: TimeZone.setDefault(null);
matterhorn-scheduler-api/src/main/java/org/opencastproject/scheduler/api/Util.java: TimeZone.setDefault(utc);
matterhorn-scheduler-api/src/main/java/org/opencastproject/scheduler/api/Util.java: TimeZone.setDefault(null);
matterhorn-scheduler-impl/src/main/java/org/opencastproject/scheduler/impl/SchedulerServiceImpl.java: TimeZone.setDefault(utc);
matterhorn-scheduler-impl/src/main/java/org/opencastproject/scheduler/impl/SchedulerServiceImpl.java: TimeZone.setDefault(null);
matterhorn-scheduler-impl/src/test/java/org/opencastproject/scheduler/impl/UtilTests.java: TimeZone.setDefault(cet);
matterhorn-scheduler-impl/src/test/java/org/opencastproject/scheduler/impl/UtilTests.java: TimeZone.setDefault(cet);

Greg Logan
April 10, 2018, 8:51 PM

This appears to be in part what's currently blocking folks outside of CEST timezones from building successfully.

Karen Dolan
December 4, 2018, 1:58 PM

Related to

Greg Logan
February 15, 2019, 9:36 PM

Now present in 6.x and develop.

Assignee

Greg Logan

Reporter

Stephen Marquard

Severity

Incorrectly Functioning With Workaround

Tags (folksonomy)

None

Components

Fix versions

Affects versions

Priority

Major
Configure