Skip to content

Commit

Permalink
Merge pull request #1325 from mozilla/correct-unit-for-sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
badboy authored Nov 17, 2020
2 parents 553b77d + 84269ce commit b32f345
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

[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.
* 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)

Expand All @@ -15,9 +21,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)
Expand Down
2 changes: 1 addition & 1 deletion bin/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions glean-core/ios/Glean/Net/HttpPingUploader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion glean-core/python/glean/glean.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions glean-core/python/glean/net/ping_upload_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


class PingUploadWorker:
_throttle_backoff_time = 60_000
_throttle_backoff_time_s = 60

@classmethod
def process(cls):
Expand All @@ -50,7 +50,7 @@ def _process(cls):
Glean._data_dir,
Glean._application_id,
Glean._configuration,
cls._throttle_backoff_time,
cls._throttle_backoff_time_s,
),
)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b32f345

Please sign in to comment.