Cannot change the timezone in existing render process through TZ ; TZ change is not monitored by timezone monitor |
||||||
Issue descriptionWhen embedding chromium sometimes it's necessary to enforce particular timezone before navigating to some URL (e.g. rendering web page using headless library). This used to work before ICU because localtime* calls from all processes were proxied to the main browser process, so setting TZ environment variable and calling tzset() was working as expected. With V8 switching to ICU this is no longer working.
,
Oct 12 2017
> v8:6031, v8:2137, v8:6076 bug v8:6031 , bug v8:2137 , bug v8:6076
,
Oct 12 2017
I don't think that would be enough. Zygote has already started, so changing timezone in the browser process explicitly will not affect the zygote - it will still run with the host's timezone. To make it work the linked line should somehow "ask" TZ from the main process instead of detecting it itself.
,
Oct 12 2017
For clarity - we are talking about changing TZ in runtime without changing TZ of the hosting system.
,
Oct 13 2017
> For clarity - we are talking about changing TZ in runtime without changing TZ of the hosting system. That was a missing piece to me. Thanks for the clarification. > Zygote has already started,so changing timezone in the browser process explicitly will not affect the zygote Yes, true. BTW, the code referred to in comment 1 is run in 'the' zygote process (as its filename implies), but once it's run at the start of the zygote process, a subsequent change in timezone does not affect the zygote process. Anyway, this bug is essentially the same as bug 612010 except that timezone monitor does not monitor TZ change. So, fixing bug 612010 and triggering timezone change event when you change TZ should work, shouldn't it?
,
Oct 13 2017
Correct, fixing the bug about propagating timezone changes to zygote + honouring TZ changes in the monitor will do the trick. That said I'm not sure I can think of an efficient way of monitoring TZ variable without polling...
,
Oct 15 2017
,
Oct 18 2017
+Ali, this may affect Node.js.
,
Mar 7 2018
,
Mar 9 2018
This seems to have come back after https://chromium-review.googlesource.com/c/v8/v8/+/857333.
,
Dec 14
bug 612010 was fixed by crrev.com/ecc9a74e8a6642d . Timezone monitor still does not monitor TZ change. However, when a new render process is forked, the ICU timezone will be updated if TZ has changed since. So, this issue is fixed for new render process, while running render processes wouldn't respond to a change in TZ. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by js...@chromium.org
, Oct 12 2017