Skip to content

Conversation

trueleo
Copy link
Contributor

@trueleo trueleo commented Sep 11, 2022

Description

This PR disallows taking stream_writer as mutable if any inner mutex is held . File creation logic is improved and is now atomic, no two threads can call set_entry at the same time. File creation was not guarded well so there could have arrived a situation where two threads tried to create the file then in that case one of thread would have failed and errored.

Changes

  • set_entry takes writer which ensures no other thread can call set_entry at the same time. File creation is atomic.
  • Addded error type StreamWriterError

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.

This PR disallows taking stream_writer as mutable if any inner mutex is held
. File creation logic is improved and is now atomic, no two threads can
call set_entry at the same time. File creation was not guarded well so there
could have arrived a situation where two threads tried to create the file then
in that case one of thread would have failed and errored.

Changes
- set_entry takes writer which ensures no other thread can call set_entry
at the same time. File creation is atomic.
- Addded error type StreamWriterError
@nitisht nitisht merged commit 2e5f0a2 into parseablehq:main Sep 11, 2022
@trueleo trueleo deleted the fix_writer branch September 11, 2022 09:07
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