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

feedback: Module fio #1063

Closed
TarantoolBot opened this issue Jan 13, 2020 · 4 comments
Closed

feedback: Module fio #1063

TarantoolBot opened this issue Jan 13, 2020 · 4 comments
Assignees
Labels
bug Something isn't working reference [location] Tarantool manual, Reference part

Comments

@TarantoolBot
Copy link
Collaborator

<…>pytree('/home/original','/home/archives')

  • true
    ...

|fio.mktree(path-name)
Create the path, including subdirectories, but without
file contents. The result is similar to the
result that one gets from the mkdir command.|

Parameters:
path-name (string) – path-name.

Return:(If no erro<…>

https://www.tarantool.io/en/doc/2.2/reference/reference_lua/fio/#fio-mktree

Create the path, including parent directories. No error if it already exists.

@rosik
Copy link
Contributor

rosik commented Jan 13, 2020

It's me

@Totktonada
Copy link
Member

Also mkdir should be mkdir -p (as pointed by @igormunkin).

@rosik
Copy link
Contributor

rosik commented Jan 13, 2020

I thought this sentence references fio.mkdir() (which doesn't have -p option), but it's still ambiguous. Let's say "The behavior is similar to the mkdir -p shell command."

HustonMmmavr added a commit to tarantool/tarantool that referenced this issue Jan 13, 2020
Despite the lack of documentation, fio.mktree() was designed to work
similar to mkdir -p: it creates the directory along with it's parents
and doesn't complain about existing ones.

But this function was subject to a race if two different processes were
trying to create the same directory at the same time. It was caused by
the fact that directory existence check and its creation aren't atomic.

This patch fixes the race by impoving error handling: it's not an error
if directory exists, even if it was created by someone else and mktree
failed.

Related to tarantool/doc#1063
Closes #4660
Totktonada pushed a commit to tarantool/tarantool that referenced this issue Jan 13, 2020
Despite the lack of documentation, fio.mktree() was designed to work
similar to mkdir -p: it creates the directory along with it's parents
and doesn't complain about existing ones.

But this function was subject to a race if two different processes were
trying to create the same directory at the same time. It was caused by
the fact that directory existence check and its creation aren't atomic.

This patch fixes the race by impoving error handling: it's not an error
if directory exists, even if it was created by someone else and mktree
failed.

Related to tarantool/doc#1063
Closes #4660
Totktonada pushed a commit to tarantool/tarantool that referenced this issue Jan 13, 2020
Despite the lack of documentation, fio.mktree() was designed to work
similar to mkdir -p: it creates the directory along with it's parents
and doesn't complain about existing ones.

But this function was subject to a race if two different processes were
trying to create the same directory at the same time. It was caused by
the fact that directory existence check and its creation aren't atomic.

This patch fixes the race by impoving error handling: it's not an error
if directory exists, even if it was created by someone else and mktree
failed.

Related to tarantool/doc#1063
Closes #4660

(cherry picked from commit 21ae289)
Totktonada pushed a commit to tarantool/tarantool that referenced this issue Jan 13, 2020
Despite the lack of documentation, fio.mktree() was designed to work
similar to mkdir -p: it creates the directory along with it's parents
and doesn't complain about existing ones.

But this function was subject to a race if two different processes were
trying to create the same directory at the same time. It was caused by
the fact that directory existence check and its creation aren't atomic.

This patch fixes the race by impoving error handling: it's not an error
if directory exists, even if it was created by someone else and mktree
failed.

Related to tarantool/doc#1063
Closes #4660

(cherry picked from commit 21ae289)
Totktonada pushed a commit to tarantool/tarantool that referenced this issue Jan 13, 2020
Despite the lack of documentation, fio.mktree() was designed to work
similar to mkdir -p: it creates the directory along with it's parents
and doesn't complain about existing ones.

But this function was subject to a race if two different processes were
trying to create the same directory at the same time. It was caused by
the fact that directory existence check and its creation aren't atomic.

This patch fixes the race by impoving error handling: it's not an error
if directory exists, even if it was created by someone else and mktree
failed.

Related to tarantool/doc#1063
Closes #4660

(cherry picked from commit 21ae289)
@lenkis lenkis added 1.10 bug Something isn't working reference [location] Tarantool manual, Reference part labels Jan 16, 2020
@Onvember
Copy link
Contributor

so should I rewrite the description like this:

Create the path, including parent directories, but without file contents. The behavior is similar to the mkdir -p shell command

?

@lenkis lenkis closed this as completed in 46a5514 Jan 29, 2020
lenkis pushed a commit that referenced this issue Jan 29, 2020
lenkis pushed a commit that referenced this issue Jan 29, 2020
avtikhon pushed a commit to avtikhon/tarantool that referenced this issue Feb 3, 2020
Despite the lack of documentation, fio.mktree() was designed to work
similar to mkdir -p: it creates the directory along with it's parents
and doesn't complain about existing ones.

But this function was subject to a race if two different processes were
trying to create the same directory at the same time. It was caused by
the fact that directory existence check and its creation aren't atomic.

This patch fixes the race by impoving error handling: it's not an error
if directory exists, even if it was created by someone else and mktree
failed.

Related to tarantool/doc#1063
Closes tarantool#4660
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working reference [location] Tarantool manual, Reference part
Projects
None yet
Development

No branches or pull requests

5 participants