From owner-freebsd-stable@freebsd.org Fri Nov 20 01:40:35 2020 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE4B447A489 for ; Fri, 20 Nov 2020 01:40:35 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2k.ore.mailhop.org (outbound2k.ore.mailhop.org [54.148.219.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CcfPv0w7wz3vNS for ; Fri, 20 Nov 2020 01:40:34 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1605836434; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Je+8pghU2VndES9r6dGK+SXRja3WBWx4rDdvKlU0Vre8eRfM4feMxArltklFTpONN8EuUatyyf01p B/UGU6xJMo6OwAAF4tr2aQY06KHltM78aFVkStY9Vf22u+mLs5AGStVmmEhMp0HAEy6G0W1HUPGzOl sudG1kSGQm29qp8A8Vmest28uX4uqenfyLMBG0qKnOKh3YiQn+ofdpI82OpMZCD6ituRQnfpmIjnMy QvNkPlx3dKd3fIbK+eHHFo3NKAL5Nzaw6ltSaOJwKXbuHv3Fcj+TuNLaKe13ZdknxFIes1hn7yfC5f 8Pz20gr+ey8MwuL65DgMmIsyO3+IUdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=aGnRJpk6BTJhTPLKKVRf4R/2mGLNDhZbLN8NboBTyHo=; b=aHIpofPdmS4NgZan9i0hDsVRsmgaclQ+OxtyVmIRn0KS2Es1ULJUDL9grrtDxXGJRcW4AS4DtGDlu Fv06Th2aLxBIZHCk5h3uAlz+KDsZQaLdQIX612xa/0n8q9G6x1bS6o3jFITyC3mIozE5k3/bF8bQ+u RpETbepFmR8wSGG43fpsok45+NjpQ5d6Ruua4ud712l5C7KeYFMBbnNUPOT4138A80QL/fcRLjxgNt OCnNSiJ094fTmRMr52doCvutq+ODtEIWO09fQaVGUKZja66J8K7mFzvhY1CtRlFb6p/EfrQ9eyhefa uSooAVjq50tcdMG7IXk1TJXJ1y/LpzQ== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=aGnRJpk6BTJhTPLKKVRf4R/2mGLNDhZbLN8NboBTyHo=; b=jEz81RsvZ1aTMmMlmdKUbK0q+a+DMimdZSuOfahLciog3LEDTzf4o4sr7n8JYfMJDuYTZjJM9MpgO 856hAUlajYe8OdhGqrj7H7KhSVVhPRRSzv/SotJFoHtoULga5w82pnFi9VLcMenH0lN43Ds5qpc+oI 1YgzNu2vWyqgvqBJckX3BxeyAKPOq74gB9VQRlOHiPubr7yzyFCvvZcRbroXhkjwXLGZCNpxr8iePA OSwEJpuN6ff/c7dfwgiPMMy0PUoCag7gFpXlnHXmMiG07sRGZEvxIRDRIKQJ4JL7m0WdvAWdx0F/0F aXoaC7itWTVr9Vov0xUkWgKkXM7kmag== X-MHO-RoutePath: aGlwcGll X-MHO-User: 5fd3d11c-2ad1-11eb-9e11-df46ed8f892f X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 5fd3d11c-2ad1-11eb-9e11-df46ed8f892f; Fri, 20 Nov 2020 01:40:32 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 0AK1eU0f051775; Thu, 19 Nov 2020 18:40:30 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <32809ec01dab023d5526b0b47fe0ad70ce558914.camel@freebsd.org> Subject: Re: NTP, UTC, and (negative) leap seconds From: Ian Lepore To: David Magda , freebsd-stable Date: Thu, 19 Nov 2020 18:40:30 -0700 In-Reply-To: <64E52A56-4C8F-4B9E-A4D3-33117C270D43@ee.ryerson.ca> References: <64E52A56-4C8F-4B9E-A4D3-33117C270D43@ee.ryerson.ca> Content-Type: text/plain; charset="iso-8859-13" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CcfPv0w7wz3vNS X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; TAGGED_RCPT(0.00)[stable]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Nov 2020 01:40:35 -0000 On Thu, 2020-11-19 at 19:50 -0500, David Magda wrote: > Hello, > > So there was a recent weblog post on a timekeeping observation: > > https://fanf.dreamwidth.org/133823.html > https://news.ycombinator.com/item?id=251458700 (via) > https://en.wikipedia.org/wiki/Leap_second > > In all circumstances in the past, leap seconds were added: > > 23:59:57Z > 23:59:58 > 23:59:59 > 23:59:60 > 00:00:00 > 00:00:01 > > The post brings up the possibility of a ´negativeˇ leap second, i.e., > a skip: > > 23:59:57Z > 23:59:58 > 00:00:00 > 00:00:01 > > Has anyone tested this scenario on FreeBSD? > > Thanks for any info. > > I run the freebsd kernel and ntpd through "negative" leap second events usually a couple times a year as part of testing our timekeeping products at $work. I'm skeptical that we'll ever see a negative leap, but we have some customers who insist on having it demonstrated to them as working correctly. The kernel and ntpd handle it just fine. No telling what any given application might do in reaction to a skipped second. I just did it now on one of our products. I scheduled a negative leap (from offset 37 to 36) to happen at the end of the day 2020-12-31, then I used a debugging command to manually force the date/time on the unit to 2020-12-31-23:58:00 and let it run. In a terminal window I had a bourne shell on that unit running while true; do sleep 1; ntptime; echo; done The output (trimmed to the range 23:59:55 - 00:00:10) looks like: ntp_gettime() returns code 2 (DEL) time e398e47b.82ebd4d0 Thu, Dec 31 2020 23:59:55.511, (.511411404), maximum error 4000 us, estimated error 5 us, TAI offset 37 ntp_adjtime() returns code 2 (DEL) modes 0x0 (), offset 4.976 us, frequency 29.182 ppm, interval 128 s, maximum error 4000 us, estimated error 5 us, status 0x2121 (PLL,DEL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 0.937 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 2 (DEL) time e398e47c.8d714b9c Thu, Dec 31 2020 23:59:56.552, (.552510729), maximum error 4500 us, estimated error 5 us, TAI offset 37 ntp_adjtime() returns code 2 (DEL) modes 0x0 (), offset 4.957 us, frequency 29.182 ppm, interval 128 s, maximum error 4500 us, estimated error 5 us, status 0x2121 (PLL,DEL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 0.988 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 2 (DEL) time e398e47d.92dbb5a0 Thu, Dec 31 2020 23:59:57.573, (.573665426), maximum error 5000 us, estimated error 5 us, TAI offset 37 ntp_adjtime() returns code 2 (DEL) modes 0x0 (), offset 4.937 us, frequency 29.182 ppm, interval 128 s, maximum error 5000 us, estimated error 5 us, status 0x2121 (PLL,DEL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 0.855 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 2 (DEL) time e398e47e.9878316c Thu, Dec 31 2020 23:59:58.595, (.595584418), maximum error 5500 us, estimated error 5 us, TAI offset 37 ntp_adjtime() returns code 2 (DEL) modes 0x0 (), offset 4.918 us, frequency 29.182 ppm, interval 128 s, maximum error 5500 us, estimated error 5 us, status 0x2121 (PLL,DEL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 1.006 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 4 (WAIT) time e398e480.9dd6cf84 Fri, Jan 1 2021 0:00:00.616, (.616559624), maximum error 6000 us, estimated error 5 us, TAI offset 36 ntp_adjtime() returns code 4 (WAIT) modes 0x0 (), offset 4.899 us, frequency 29.182 ppm, interval 128 s, maximum error 6000 us, estimated error 5 us, status 0x2121 (PLL,DEL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 1.010 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 4 (WAIT) time e398e481.a323571c Fri, Jan 1 2021 0:00:01.637, (.637258156), maximum error 6500 us, estimated error 5 us, TAI offset 36 ntp_adjtime() returns code 4 (WAIT) modes 0x0 (), offset 4.880 us, frequency 29.182 ppm, interval 128 s, maximum error 6500 us, estimated error 5 us, status 0x2121 (PLL,DEL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 1.025 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 4 (WAIT) time e398e482.a8977424 Fri, Jan 1 2021 0:00:02.658, (.658561327), maximum error 7000 us, estimated error 5 us, TAI offset 36 ntp_adjtime() returns code 4 (WAIT) modes 0x0 (), offset 4.861 us, frequency 29.182 ppm, interval 128 s, maximum error 7000 us, estimated error 5 us, status 0x2121 (PLL,DEL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 1.037 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 4 (WAIT) time e398e483.ade1f3a4 Fri, Jan 1 2021 0:00:03.679, (.679229584), maximum error 7500 us, estimated error 5 us, TAI offset 36 ntp_adjtime() returns code 4 (WAIT) modes 0x0 (), offset 4.842 us, frequency 29.182 ppm, interval 128 s, maximum error 7500 us, estimated error 5 us, status 0x2121 (PLL,DEL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 1.014 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 4 (WAIT) time e398e484.b3448064 Fri, Jan 1 2021 0:00:04.700, (.700264111), maximum error 8000 us, estimated error 5 us, TAI offset 36 ntp_adjtime() returns code 4 (WAIT) modes 0x0 (), offset 4.823 us, frequency 29.182 ppm, interval 128 s, maximum error 8000 us, estimated error 5 us, status 0x2121 (PLL,DEL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 1.051 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 4 (WAIT) time e398e485.b8a6dacc Fri, Jan 1 2021 0:00:05.721, (.721296182), maximum error 8500 us, estimated error 5 us, TAI offset 36 ntp_adjtime() returns code 4 (WAIT) modes 0x0 (), offset 4.804 us, frequency 29.182 ppm, interval 128 s, maximum error 8500 us, estimated error 5 us, status 0x2121 (PLL,DEL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 1.079 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 4 (WAIT) time e398e486.bddfdac8 Fri, Jan 1 2021 0:00:06.741, (.741697917), maximum error 1000 us, estimated error 4 us, TAI offset 36 ntp_adjtime() returns code 4 (WAIT) modes 0x0 (), offset 4.060 us, frequency 29.182 ppm, interval 128 s, maximum error 1000 us, estimated error 4 us, status 0x2101 (PLL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 0.911 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 0 (OK) time e398e487.cf8a7e74 Fri, Jan 1 2021 0:00:07.810, (.810707099), maximum error 1500 us, estimated error 4 us, TAI offset 36 ntp_adjtime() returns code 0 (OK) modes 0x0 (), offset 4.044 us, frequency 29.182 ppm, interval 128 s, maximum error 1500 us, estimated error 4 us, status 0x2101 (PLL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 0.826 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 0 (OK) time e398e488.d4da7f3c Fri, Jan 1 2021 0:00:08.831, (.831459235), maximum error 2000 us, estimated error 4 us, TAI offset 36 ntp_adjtime() returns code 0 (OK) modes 0x0 (), offset 4.028 us, frequency 29.182 ppm, interval 128 s, maximum error 2000 us, estimated error 4 us, status 0x2101 (PLL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 0.809 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 0 (OK) time e398e489.da869404 Fri, Jan 1 2021 0:00:09.853, (.853616381), maximum error 2500 us, estimated error 4 us, TAI offset 36 ntp_adjtime() returns code 0 (OK) modes 0x0 (), offset 4.012 us, frequency 29.182 ppm, interval 128 s, maximum error 2500 us, estimated error 4 us, status 0x2101 (PLL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 0.796 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. ntp_gettime() returns code 0 (OK) time e398e48a.e0216c60 Fri, Jan 1 2021 0:00:10.875, (.875510596), maximum error 3000 us, estimated error 4 us, TAI offset 36 ntp_adjtime() returns code 0 (OK) modes 0x0 (), offset 3.996 us, frequency 29.182 ppm, interval 128 s, maximum error 3000 us, estimated error 4 us, status 0x2101 (PLL,PPSSIGNAL,NANO), time constant 4, precision 0.001 us, tolerance 496 ppm, pps frequency 29.089 ppm, stability 0.128 ppm, jitter 0.653 us, intervals 23, jitter exceeded 6, stability exceeded 0, errors 2. -- Ian