Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1676712 - Use the correct time unit for sleeps in Swift and Python #1325

Merged
merged 4 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
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