Skip to content

Commit

Permalink
Better mitigation for 126 being 500 on prod because of huge logs to p…
Browse files Browse the repository at this point in the history
…arse
  • Loading branch information
pascalchevrel committed May 14, 2024
1 parent 9c9d21d commit 4be69a4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
29 changes: 18 additions & 11 deletions app/models/past_release.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

use ReleaseInsights\{Bugzilla as Bz, Json, Release, URL, Utils, Version};
use ReleaseInsights\{Bugzilla as Bz, Json, Release, URL, Performance, Utils, Version};

// Historical data from Product Details
$firefox_releases = Json::load(URL::ProductDetails->value . 'firefox.json')['releases'];
Expand Down Expand Up @@ -137,24 +137,31 @@
?? $devedition_releases['devedition-' . $requested_version . 'b3']['date'];
}

Performance::log();
// Number of bugs fixed in nightly
$nightly_fixes = Bz::getBugsFromHgWeb(
URL::Mercurial->value
.'mozilla-central/json-pushes'
. '?fromchange=FIREFOX_NIGHTLY_' . ((int) $requested_version - 1) . '_END'
. '&tochange=FIREFOX_NIGHTLY_' . (int) $requested_version .'_END'
. '&full&version=2',
true,
-1
);

if ($requested_version == '126.0') {
// 126 was the big merge to mercurial for Android, parsing the log exhausts the memory allocated by Nginx
$nightly_fixes = 0;
} else {
$nightly_fixes = Bz::getBugsFromHgWeb(
URL::Mercurial->value
.'mozilla-central/json-pushes'
. '?fromchange=FIREFOX_NIGHTLY_' . ((int) $requested_version - 1) . '_END'
. '&tochange=FIREFOX_NIGHTLY_' . (int) $requested_version .'_END'
. '&full&version=2',
true,
-1
);
}
Performance::log();
$no_planned_dot_releases = (new Release($requested_version))->no_planned_dot_releases;

// Check current rollout for the release channel
if ((int) $requested_version === RELEASE) {
$rollout = Json::load(URL::Balrog->value . 'rules/firefox-release')['backgroundRate'];
}

// Performance::log();
return [
$last_release_date,
$previous_release_date,
Expand Down
8 changes: 7 additions & 1 deletion app/views/templates/past_release.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@
</tr>
{% if release > 57 %}
<tr>
<th>Bugs fixed in nightly</th><td>{{ nightly_fixes.bug_fixes|length }}</td>
<th>Bugs fixed in nightly</th><td>
{% if release == 126 %}
N/A
{% else %}
{{ nightly_fixes.bug_fixes|length }}
{% endif %}
</td>
</tr>
{% endif %}

Expand Down
3 changes: 1 addition & 2 deletions docker/php-fpm.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ php_admin_value[opcache.memory_consumption] = 128
php_admin_value[opcache.interned_strings_buffer] = 8
php_admin_value[opcache.max_accelerated_files] = 4000
php_admin_value[opcache.revalidate_freq] = 60
php_admin_value[opcache.enable_cli] = 1
php_admin_value[memory_limit] = 256M
php_admin_value[opcache.enable_cli] = 1

0 comments on commit 4be69a4

Please sign in to comment.