From f6b44954693410bae5dfc9e68eaadb818554edf1 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Tue, 17 Nov 2020 11:02:54 +0100 Subject: [PATCH 1/4] Fix changelog entry This was placed wrongly during a merge. --- CHANGELOG.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d076b3eb8..fa3fbc4948 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ [Full changelog](https://github.com/mozilla/glean/compare/v33.3.0...main) +* General + * When Rkv's safe mode is enabled (`features = ["rkv-safe-mode"]` on the `glean-core` crate) LMDB data is migrated at first start ([#1322](https://github.com/mozilla/glean/pull/1322)). * Rust * Introduce the Counter metric type in the RLB. * Introduce the String metric type in the RLB. @@ -15,9 +17,6 @@ * Rust * Implement the experiments API ([#1314](https://github.com/mozilla/glean/pull/1314)) -* General - * When Rkv's safe mode is enabled (`features = ["rkv-safe-mode"]` on the `glean-core` crate) LMDB data is migrated at first start ([#1322](https://github.com/mozilla/glean/pull/1322)). - # v33.2.0 (2020-11-10) [Full changelog](https://github.com/mozilla/glean/compare/v33.1.2...v33.2.0) From 356bf454bf50694a626d72e74a7bff1b1c1b3897 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Tue, 17 Nov 2020 11:01:26 +0100 Subject: [PATCH 2/4] Use the correct time unit for sleeps in Swift and Python --- glean-core/ios/Glean/Net/HttpPingUploader.swift | 4 ++-- glean-core/python/glean/glean.py | 2 +- glean-core/python/glean/net/ping_upload_worker.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/glean-core/ios/Glean/Net/HttpPingUploader.swift b/glean-core/ios/Glean/Net/HttpPingUploader.swift index 06431ddd8a..45a48ff9fb 100644 --- a/glean-core/ios/Glean/Net/HttpPingUploader.swift +++ b/glean-core/ios/Glean/Net/HttpPingUploader.swift @@ -13,7 +13,7 @@ public class HttpPingUploader { // Since ping file names are UUIDs, this matches UUIDs for filtering purposes static let logTag = "glean/HttpPingUploader" static let connectionTimeout = 10000 - static let throttleBackoffMs: UInt32 = 60_000 + static let throttleBackoffS: UInt32 = 60 // For this error, the ping will be retried later static let recoverableErrorStatusCode: UInt16 = 500 @@ -118,7 +118,7 @@ public class HttpPingUploader { glean_process_ping_upload_response(&incomingTask, result.toFfi()) } case .wait: - sleep(Constants.throttleBackoffMs) + sleep(Constants.throttleBackoffS) continue case .done: return diff --git a/glean-core/python/glean/glean.py b/glean-core/python/glean/glean.py index e3e31ac814..3c0eaa4062 100644 --- a/glean-core/python/glean/glean.py +++ b/glean-core/python/glean/glean.py @@ -231,7 +231,7 @@ def _initialize_with_tempdir_for_testing( again or at process shutdown. """ # Lower throttle backoff time for testing - PingUploadWorker._throttle_backoff_time = 1 + PingUploadWorker._throttle_backoff_time_s = 1 actual_data_dir = Path(tempfile.TemporaryDirectory().name) cls.initialize( diff --git a/glean-core/python/glean/net/ping_upload_worker.py b/glean-core/python/glean/net/ping_upload_worker.py index 4c98343950..645547c4fe 100644 --- a/glean-core/python/glean/net/ping_upload_worker.py +++ b/glean-core/python/glean/net/ping_upload_worker.py @@ -23,7 +23,7 @@ class PingUploadWorker: - _throttle_backoff_time = 60_000 + _throttle_backoff_time_s = 60 @classmethod def process(cls): @@ -50,7 +50,7 @@ def _process(cls): Glean._data_dir, Glean._application_id, Glean._configuration, - cls._throttle_backoff_time, + cls._throttle_backoff_time_s, ), ) @@ -103,7 +103,7 @@ def _parse_ping_headers( def _process( - data_dir: Path, application_id: str, configuration, throttle_backoff_time: int + data_dir: Path, application_id: str, configuration, throttle_backoff_time_s: int ) -> bool: # Import here to avoid cyclical import @@ -154,7 +154,7 @@ def _process( incoming_task, upload_result.to_ffi() ) elif tag == UploadTaskTag.WAIT: - time.sleep(throttle_backoff_time) + time.sleep(throttle_backoff_time_s) elif tag == UploadTaskTag.DONE: return True From e3bbc3fa43d72768bc00a4eb97b1805e9c968faa Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Tue, 17 Nov 2020 11:12:18 +0100 Subject: [PATCH 3/4] Detect _any_ Xcode 12.x version during carthage bootstrapping --- bin/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/bootstrap.sh b/bin/bootstrap.sh index 06a22a93da..e70cab631f 100755 --- a/bin/bootstrap.sh +++ b/bin/bootstrap.sh @@ -6,7 +6,7 @@ # Xcode 12 -- Carthage workaround # See https://github.com/Carthage/Carthage/issues/3019 -if xcodebuild -version | grep -q "Xcode 12.0"; then +if xcodebuild -version | grep -q "Xcode 12."; then xcconfig="${PWD}/tmp.xcconfig" true > "$xcconfig" echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8' >> "$xcconfig" From 84269cea0e75d15fb0a2486ac85c3bd4cda350e8 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Tue, 17 Nov 2020 11:21:59 +0100 Subject: [PATCH 4/4] Document bug fix in the changelog [doc only] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa3fbc4948..7622359e02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ * Rust * Introduce the Counter metric type in the RLB. * Introduce the String metric type in the RLB. +* Python + * BUGFIX: Fix too-long sleep time in uploader due to unit mismatch ([#1325](https://github.com/mozilla/glean/pull/1325)). +* Swift + * BUGFIX: Fix too-long sleep time in uploader due to unit mismatch ([#1325](https://github.com/mozilla/glean/pull/1325)). # v33.3.0 (2020-11-12)