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

Do msgs mixed with each other when many clients call log_error at the same time? #2

Open
shangshujie365 opened this issue Jan 11, 2017 · 1 comment

Comments

@shangshujie365
Copy link

Hi, are you still working on this project?
I have a question, if many client call 'select log_error' at the same time, will the msg wrote to error file be mixed with each other? Because many threads write a single file at the same time.
If so, How to solve this problem? Do we need a lock to protect data before we write msg out?

@federico-razzoli
Copy link

I'm no developer, but here's my understanding:

  • A single sprintf() call is thread safe, as required by POSIX. So a line should never be corrupted.
  • Multiple sprintf() calls from multiple threads can be reorder, so never try to call this UDF to print consecutive lines.

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

No branches or pull requests

2 participants