Skip to content

fix(core): Make sure logs get flushed in server-runtime-client #16222

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

Merged
merged 1 commit into from
May 7, 2025

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented May 7, 2025

Actually fixes #16110

@AbhiPrasad AbhiPrasad requested review from andreiborza and a team May 7, 2025 16:07
@AbhiPrasad AbhiPrasad self-assigned this May 7, 2025
@AbhiPrasad AbhiPrasad requested review from chargome and removed request for a team May 7, 2025 16:07
@@ -72,6 +73,10 @@ export class ServerRuntimeClient<
}, DEFAULT_LOG_FLUSH_INTERVAL);
}
});

client.on('flush', () => {
_INTERNAL_flushLogsBuffer(client);
Copy link
Member

Choose a reason for hiding this comment

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

Should we also cancel _logFlushIdleTimeout here?

Copy link
Member Author

@AbhiPrasad AbhiPrasad May 7, 2025

Choose a reason for hiding this comment

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

this should be done by the client.on('flushLogs' callback, which should be called as soon as the logs actually get flushed (from the _INTERNAL_flushLogsBuffer call).

The test validates this by showing the client['_logWeight'] is 0, which means we executed that code block.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, thanks for the explanation.

@andreiborza andreiborza merged commit 22a0e35 into develop May 7, 2025
157 checks passed
@andreiborza andreiborza deleted the abhi-flush-server-runtime-client branch May 7, 2025 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logs not fully ingested by Sentry from AWS lambdas
2 participants