Skip to content

Swarming: Removes Unnecessary DB calls#5223

Merged
IvanBM18 merged 10 commits intomasterfrom
feature/swarming/remove_unnecesary_db_calls
Apr 8, 2026
Merged

Swarming: Removes Unnecessary DB calls#5223
IvanBM18 merged 10 commits intomasterfrom
feature/swarming/remove_unnecesary_db_calls

Conversation

@IvanBM18
Copy link
Copy Markdown
Collaborator

@IvanBM18 IvanBM18 commented Mar 27, 2026

We are adding back the last batch of the changes that were rollbacked which make sure that we weren't making a lot of unnecessary calls into the DB. By consequence the signature of multiple methods were changed to simplified.

I also added a new tests to avoid the previous issue (the one that caused the rollback) from ever appearing again. This tests are in its own test class and its purpose is to check that the BadConfigError is correctly handled when no config is found(which is the expected bahaviour in the external and google envs)

Tests performed in dev environment

This changes have been present since March 25th. Its been over one week since then and metrics seem consistent
image
Note: Down times in fuzzing hours matches when we deployed a change into the env.

Also no new error groups seem to be appearing in swarming, the only notable error is one relating missing permissions for uploading a test case, which seems unrelated

This changes have been in dev for quite some time and we have successfully tested their functionality without compromising any functionality. For example this Task was scheduled with this changes.

@IvanBM18 IvanBM18 self-assigned this Mar 27, 2026
@IvanBM18 IvanBM18 added the swarming Changes related to the clusterfuzz-swarming integration label Mar 27, 2026
@IvanBM18 IvanBM18 marked this pull request as ready for review March 30, 2026 22:40
@IvanBM18 IvanBM18 requested a review from a team as a code owner March 30, 2026 22:40
def is_swarming_task(job_name: str, job: data_types.Job | None = None) -> bool:
"""Returns True if the task is supposed to run on swarming."""
if not FeatureFlags.SWARMING_REMOTE_EXECUTION.enabled:
logs.info('[DEBUG] Flag is disabled', job_name=job_name)
Copy link
Copy Markdown
Collaborator Author

@IvanBM18 IvanBM18 Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Theres no debug severity level in the logs module. I tried adding it but the logs were not being shown in the GCP log explorer when in debug, i guessed thats why didn't had said severity level in the first place

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use warning for this kind of debug log.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like moving it up to warning can be very noisy, for something that its not really a warning but more of a note for knowing why a given task ended up in swarming.

I'll instead fromat the logs as logs.info('[Swarming DEBUG] ....') this way it doesnt look as odd.. while we can still search for them :D

@javanlacerda
Copy link
Copy Markdown
Collaborator

@jardondiego could you review it before I do?

@jardondiego
Copy link
Copy Markdown
Collaborator

As discussed offline, I was under the understanding that we would focus only on the changes that are needed the most to finalize the integration, I am okay with moving forward but I suggest we prioritize that work instead.

@jardondiego
Copy link
Copy Markdown
Collaborator

jardondiego commented Apr 5, 2026

Please fix failing checks.

Copy link
Copy Markdown
Collaborator

@jardondiego jardondiego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@IvanBM18
Copy link
Copy Markdown
Collaborator Author

IvanBM18 commented Apr 6, 2026

Please fix failing checks.

This checks are failing due to external reasons as per @javanlacerda : "We're aware on this issue, we'll be addressing it soon. you can ignore for now"

Copy link
Copy Markdown
Collaborator

@javanlacerda javanlacerda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Did you manage to see the logs with the new schedule stage in dev? Could you attach it here?

def is_swarming_task(job_name: str, job: data_types.Job | None = None) -> bool:
"""Returns True if the task is supposed to run on swarming."""
if not FeatureFlags.SWARMING_REMOTE_EXECUTION.enabled:
logs.info('[DEBUG] Flag is disabled', job_name=job_name)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use warning for this kind of debug log.

Co-authored-by: Javan Lacerda <javanlacerda@google.com>
@IvanBM18
Copy link
Copy Markdown
Collaborator Author

IvanBM18 commented Apr 8, 2026

attach

Sure, heres a log with the scheduler stage being shown at the log's extras fields
image

@IvanBM18 IvanBM18 merged commit b97b50d into master Apr 8, 2026
9 of 10 checks passed
@IvanBM18 IvanBM18 deleted the feature/swarming/remove_unnecesary_db_calls branch April 8, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

swarming Changes related to the clusterfuzz-swarming integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants