Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007357 [Squeak] Kernel minor always 06-27-09 17:53 04-18-10 22:06
Reporter lewis View Status public  
Assigned To lewis
Priority normal Resolution fixed  
Status closed   Product Version 3.10.1
Summary 0007357: DateAndTime class>>localOffset broken since Mantis 474
Description One of the change sets from Mantis 474 (Improve Date And Time.4.cs) attempts to improve performance by improperly caching the current value of the local time zone offset in a LocalOffset class variable in class DateAndTime. This breaks any application, e.g. TimeZoneDatabase, that relies on finding the correct value of the offset for a given time zone and for a given time at which the offset value is to be determined.

This is broken in Squeak 3.10.1 and any other images that may have included the Mantis 474 changes (Pharo?).

The original implementation of #localOffset in Squeak Chronology was correct for its intended purpose. The "improved" version should be reverted, and the LocalOffset class variable should be removed.
Additional Information
Attached Files  RemoveCachedLocalOffset-dtl-M7357.2.cs [^] (2,144 bytes) 07-13-09 17:23

- Relationships
related to 0000474closed KenCausey [BUG][FIX] accurateDateAndTimeNow-brp 
related to 0007273closed lewis DateAndTime class>>localTimeZone: does not work 

- Notes
(0013177 - 53 - 53 - 53 - 53 - 53 - 53)
Keith_Hodges
07-11-09 22:47

I am confused, how many timezones can an image be in?
 
(0013178 - 435 - 471 - 471 - 471 - 471 - 471)
lewis
07-11-09 23:12

An image is in one timezone at a time(*).

One to many timezones may exist in an image, referring to one or more physical locations.

An instant in time may be expressed with respect to the current local timezone, or with respect to a timezone in some other part of the world.

(*) Actually, if your image is currently located in Detroit, Michigan USA, there are several time zone tables that may apply to this physical location.
 
(0013179 - 226 - 250 - 250 - 250 - 250 - 250)
Keith_Hodges
07-12-09 02:07

Are you saying that after an image starts up, its timezone offset could change?

Surly you just need to nil the cached value when the day roll over occurs.

We had problems with this really slowing down Logging in Gjallar.
 
(0013181 - 395 - 431 - 431 - 431 - 431 - 431)
lewis
07-13-09 17:26

Fix attached in RemoveCachedLocalOffset-dtl-M7357

This restores the original implementation of DateAndTime class>>localOffset (including original author initials and time stamp, but with <lf> characters removed from source) and eliminates class variable LocalOffset from DateAndTime.

This restores the original correct implementation. As far as I can tell, there is no performance penalty.
 
(0013191 - 108 - 108 - 108 - 108 - 108 - 108)
lewis
07-14-09 12:30

Note, the fix in RemoveCachedLocalOffset-dtl-M7357 also resolves Mantis 7273, a previously reported problem.
 
(0013192 - 55 - 55 - 55 - 55 - 55 - 55)
lewis
07-14-09 22:51

Patch applied in source.squeak.org/trunk Kernel-dtl.186
 

- Issue History
Date Modified Username Field Change
06-27-09 17:53 lewis New Issue
06-27-09 17:53 lewis Issue Monitored: lewis
06-27-09 17:53 lewis Relationship added related to 0000474
07-11-09 22:47 Keith_Hodges Note Added: 0013177
07-11-09 23:12 lewis Note Added: 0013178
07-12-09 02:07 Keith_Hodges Note Added: 0013179
07-13-09 17:20 lewis File Added: RemoveCachedLocalOffset-dtl-M7357.1.cs
07-13-09 17:23 lewis File Added: RemoveCachedLocalOffset-dtl-M7357.2.cs
07-13-09 17:23 lewis File Deleted: RemoveCachedLocalOffset-dtl-M7357.1.cs
07-13-09 17:26 lewis Note Added: 0013181
07-14-09 01:49 lewis Relationship added related to 0007273
07-14-09 12:18 lewis Status new => assigned
07-14-09 12:18 lewis Assigned To  => lewis
07-14-09 12:30 lewis Note Added: 0013191
07-14-09 22:51 lewis Status assigned => resolved
07-14-09 22:51 lewis Resolution open => fixed
07-14-09 22:51 lewis Note Added: 0013192
04-18-10 22:06 andreas Status resolved => closed


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
76 total queries executed.
46 unique queries executed.
Powered by Mantis Bugtracker