Skip to content

Conversation

@trueleo
Copy link
Contributor

@trueleo trueleo commented Oct 3, 2022

Description

When multiple requests reaches event processing too quickly then many threads race to register first event. This is problematic as it means server may drop many request after panicking on local writer.

This PR fixes this issue by locking metadata with write lock beforehand in case of first event. This prevents other thread from reading metadata and thus blocks other requests until first event has processed.

Todo

  • This can be seperate issue but as metadata expects that all it's method are panic free there should not be any panic inside s3 client when processing for first event

This PR has:

  • been tested to ensure log ingestion and log query works.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added documentation for new or modified features or behaviors.

@nitisht nitisht self-requested a review October 3, 2022 06:57
When multiple requests reaches event processing too quickly then many threads
race to register first event. This is problematic as it means server may drop
many request after erroring/panicking on local writer.

This PR fixes this issue by locking metadata with write lock beforehand in
case of first event. This prevents other thread from reading metadata and
thus blocks other requests until first event has processed.

Todo: This can be seperate issue but as metadata expects that all it's
method are panic free there should not be any panic inside s3 client
when processing for first event
@nitisht nitisht merged commit f3fffb9 into parseablehq:main Oct 3, 2022
@trueleo trueleo deleted the first_event branch October 4, 2022 04:52
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.

2 participants