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

bugfix: avoid logging non-200 response and don't publish mesasge when there is error #573

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

khorshuheng
Copy link
Collaborator

Description

Currently, empty message might be published when there is non-200 response, or when there is error building the Kafka log. The observation publisher will crash as a result because the consumer currently doesn't handle the scenario when the Kafka message value is null.

Modifications

  • Prevent producing Kafka message when the response code is not 200, or when there is error building the Kafka log.
  • Skip message with null message for the observation publisher

Tests

Checklist

  • Added PR label
  • Added unit test, integration, and/or e2e tests
  • Tested locally
  • Updated documentation
  • Update Swagger spec if the PR introduce API changes
  • Regenerated Golang and Python client if the PR introduces API changes

Release Notes


@khorshuheng khorshuheng added the bug Something isn't working label Apr 18, 2024
Copy link
Contributor

@tiopramayudi tiopramayudi left a comment

Choose a reason for hiding this comment

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

left one comment the rest is LGTM! Thanks @khorshuheng

api/pkg/inference-logger/logger/mlobs_sink.go Outdated Show resolved Hide resolved
@khorshuheng khorshuheng force-pushed the prevent-publishing-empty-value-message branch from ea676ec to a5a3099 Compare April 18, 2024 06:32
@khorshuheng khorshuheng force-pushed the prevent-publishing-empty-value-message branch from a5a3099 to ceb306f Compare April 18, 2024 07:10
@khorshuheng khorshuheng merged commit b5733e5 into main Apr 18, 2024
34 checks passed
@khorshuheng khorshuheng deleted the prevent-publishing-empty-value-message branch April 18, 2024 07:57
khorshuheng added a commit that referenced this pull request Apr 18, 2024
… there is error (#573)

<!--  Thanks for sending a pull request!  Here are some tips for you:

1. Run unit tests and ensure that they are passing
2. If your change introduces any API changes, make sure to update the
e2e tests
3. Make sure documentation is updated for your PR!

-->
# Description
<!-- Briefly describe the motivation for the change. Please include
illustrations where appropriate. -->
Currently, empty message might be published when there is non-200
response, or when there is error building the Kafka log. The observation
publisher will crash as a result because the consumer currently doesn't
handle the scenario when the Kafka message value is null.

# Modifications
<!-- Summarize the key code changes. -->
- Prevent producing Kafka message when the response code is not 200, or
when there is error building the Kafka log.
- Skip message with null message for the observation publisher

# Tests
<!-- Besides the existing / updated automated tests, what specific
scenarios should be tested? Consider the backward compatibility of the
changes, whether corner cases are covered, etc. Please describe the
tests and check the ones that have been completed. Eg:
- [x] Deploying new and existing standard models
- [ ] Deploying PyFunc models
-->

# Checklist
- [ ] Added PR label
- [ ] Added unit test, integration, and/or e2e tests
- [ ] Tested locally
- [ ] Updated documentation
- [ ] Update Swagger spec if the PR introduce API changes
- [ ] Regenerated Golang and Python client if the PR introduces API
changes

# Release Notes
<!--
Does this PR introduce a user-facing change?
If no, just write "NONE" in the release-note block below.
If yes, a release note is required. Enter your extended release note in
the block below.
If the PR requires additional action from users switching to the new
release, include the string "action required".

For more information about release notes, see kubernetes' guide here:
http://git.k8s.io/community/contributors/guide/release-notes.md
-->

```release-note

```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants