Gerrit sync queue is showing different timezone however my server is in diff timezone

146 views
Skip to first unread message

rahulkuma...@motorolasolutions.com

unread,
Oct 12, 2017, 3:25:37 PM10/12/17
to Repo and Gerrit Discussion
Hello Team:

My server is in EDT timezone i changed it from UTC to EDT, when i run date command it is showing me like
gerritmasterserver$ date
Thu Oct 12 15:10:22 EDT 2017

however when i reload replication it is showing me UTC time :(

gerritmasterserver$ ssh -p 29418 gerrit2.mot-solutions.com gerrit show-queue -w
Task     State        StartTime         Command
------------------------------------------------------------------------------
15d915f6 19:10:58.324 19:09:58.325      Plugin Cleaner (waiting for 1 plugins)
2ba5d6d4 15:02:59.281 14:02:59.282      Log File Compressor
------------------------------------------------------------------------------
 
2 tasks

Any idea what needs to fix ?

Thanks in adavance

Doug Robinson

unread,
Oct 13, 2017, 4:26:22 PM10/13/17
to Repo and Gerrit Discussion
Are you sure you don't have a TZ environment variable in your environment?

Please execute this:   env -i PATH="$PATH" date

rahulkuma...@motorolasolutions.com

unread,
Oct 19, 2017, 4:08:40 PM10/19/17
to Repo and Gerrit Discussion
Hello:

Yes i do have this variable and this is showing me time in EDT 

# env -i PATH="$PATH" date
Thu Oct 19 16:06:30 EDT 2017

Doug Robinson

unread,
Oct 20, 2017, 4:31:19 PM10/20/17
to rahulkuma...@motorolasolutions.com, Repo and Gerrit Discussion
The command "env -i" will strip all environment variables out other than those shown on the command line and then run the command.  Doing it this way eliminates the interference of the TZ environment variable (and other possibilities).

According to that output your system time is set to EDT.

--
--
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/repo-discuss/xWuRs8zk7es/unsubscribe.
To unsubscribe from this group and all its topics, send an email to repo-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
DOUGLAS B ROBINSON SENIOR PRODUCT MANAGER

World Leader in Active Data Replication™
Find out more wandisco.com

THIS MESSAGE AND ANY ATTACHMENTS ARE CONFIDENTIAL, PROPRIETARY AND MAY BE PRIVILEGED

If this message was misdirected, WANdisco, Inc. and its subsidiaries, ("WANdisco") does not waive any confidentiality or privilege. If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone. Any distribution, use or copying of this email or the information it contains by other than an intended recipient is unauthorized. The views and opinions expressed in this email message are the author's own and may not reflect the views and opinions of WANdisco, unless the author is authorized by WANdisco to express such views or opinions on its behalf. All email sent to or from this address is subject to electronic storage and review by WANdisco. Although WANdisco operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.

rahulkuma...@motorolasolutions.com

unread,
Oct 22, 2017, 11:32:39 PM10/22/17
to Repo and Gerrit Discussion
Thanks for your reply

env -i is not showing me anything :(

--
--
To unsubscribe, email repo-discuss...@googlegroups.com

More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/repo-discuss/xWuRs8zk7es/unsubscribe.
To unsubscribe from this group and all its topics, send an email to repo-discuss...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
DOUGLAS B ROBINSON SENIOR PRODUCT MANAGER

Doug Robinson

unread,
Oct 23, 2017, 2:08:33 PM10/23/17
to Repo and Gerrit Discussion


On Sunday, October 22, 2017 at 11:32:39 PM UTC-4, rahulkuma...@motorolasolutions.com wrote:
Thanks for your reply

env -i is not showing me anything :(

I'll try to explain this again.  You ran the command that I asked, and it did the following:

# env -i PATH="$PATH" date
Thu Oct 19 16:06:30 EDT 2017

Since the "env" command, using the "-i" option has removed all of the environment variables other than PATH (including TZ) from the environment and then ran the "date" command then it tells us that your system clock is, as you stated, set to EDT.  This is a totally independent verification.

What this does is to isolate the issue where Gerrit is printing out UTC to some setting either in Gerrit itself or set during Gerrit's startup.

I assume this isn't as easy as consulting the "gerrit.conf" file and finding the Timezone setting in there set to UTC.  Otherwise I expect you would have found/fixed this without any question here.

The next step would be to check how Gerrit is being started up on your system?  If it is being manually started by an administrator then you might want to check their environment for the TZ environment variable (or some such).

In general, process environment contamination during an application startup is one of the reasons to use the "service" command (assuming a pre-systemd system): on some/most of the systems that I use the "/sbin/service" command makes use of the "env -i" command to very strictly control the application's environment.

Cheers.

On Thursday, October 12, 2017 at 3:25:37 PM UTC-4, rahulkuma...@motorolasolutions.com wrote:
My server is in EDT timezone i changed it from UTC to EDT, when i run date command it is showing me like
gerritmasterserver$ date
Thu Oct 12 15:10:22 EDT 2017

however when i reload replication it is showing me UTC time :(

gerritmasterserver$ ssh -p 29418 gerrit2.mot-solutions.com gerrit show-queue -w
Task     State        StartTime         Command
------------------------------------------------------------------------------
15d915f6 19:10:58.324 19:09:58.325      Plugin Cleaner (waiting for 1 plugins)
2ba5d6d4 15:02:59.281 14:02:59.282      Log File Compressor
------------------------------------------------------------------------------
 
2 tasks


--
DOUGLAS B ROBINSON SENIOR PRODUCT MANAGER
Reply all
Reply to author
Forward
0 new messages