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

fix: Event sink errors when enabled models are missing #97

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

bmtcril
Copy link
Contributor

@bmtcril bmtcril commented Oct 4, 2024

When event sinks are enabled in the config or waffle flag, but the model itself doesn't exist we were throwing errors that caused downstream errors. We now warn on this condition and return the model as disabled instead.

Still needs manual testing, leaving in draft for now.

Closes: #96

Copy link

github-actions bot commented Oct 4, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  platform_plugin_aspects
  __init__.py
  platform_plugin_aspects/sinks
  base_sink.py 365-368
Project Total  

This report was generated by python-coverage-comment-action

@bmtcril bmtcril self-assigned this Oct 4, 2024
@bmtcril bmtcril requested a review from Ian2012 October 4, 2024 19:50
@Ian2012
Copy link
Contributor

Ian2012 commented Oct 4, 2024

@bmtcril Tested locally by removing the course_enrollment entry from EVENT_SINK_CLICKHOUSE_MODEL_CONFIG

lms-1  | 2024-10-04 20:38:14,936 INFO 113 [tracking] [user 6] [ip 172.18.0.1] logger.py:41 - {"name": "edx.course.enrollment.activated", "context": {"user_id": 6, "path": "/change_enrollment", "course_id": "course-v1:OpenedX+DemoX+DemoCourse", "org_id": "OpenedX", "enterprise_uuid": ""}, "username": "admin", "session": "dc1fef98626413e0576e133d403b0062", "ip": "172.18.0.1", "agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36", "host": "local.edly.io:8000", "referer": "http://local.edly.io:8000/courses/course-v1:OpenedX+DemoX+DemoCourse/about", "accept_language": "en-US,en;q=0.9,es;q=0.8", "event": {"user_id": 6, "course_id": "course-v1:OpenedX+DemoX+DemoCourse", "mode": "audit"}, "time": "2024-10-04T20:38:14.522547+00:00", "event_type": "edx.course.enrollment.activated", "event_source": "server", "page": null}
lms-1  | 2024-10-04 20:38:14,945 INFO 113 [celery.app.trace] [user 6] [ip 172.18.0.1] trace.py:128 - Task platform_plugin_aspects.tasks.dump_data_to_clickhouse[914fb4b7-e719-4a88-b5bb-6d4bbbeccf35] succeeded in 0.0012879549994977424s: 'Disabled'

@bmtcril bmtcril force-pushed the bmtcril/fix_missing_model_sink branch from 6501bcb to 0f95663 Compare October 8, 2024 13:43
@bmtcril bmtcril marked this pull request as ready for review October 8, 2024 13:43
@bmtcril bmtcril requested a review from saraburns1 October 8, 2024 13:44
When event sinks are enabled in the config or waffle flag, but the model
itself doesn't exist we were throwing errors that caused downstream
errors. We now warn on this condition and return the model as disabled
instead.
@bmtcril bmtcril force-pushed the bmtcril/fix_missing_model_sink branch from 0f95663 to 055f883 Compare October 8, 2024 16:29
@bmtcril bmtcril merged commit 62be4ea into main Oct 8, 2024
10 checks passed
@bmtcril bmtcril deleted the bmtcril/fix_missing_model_sink branch October 8, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
3 participants