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

Not handled response in ets:tab2file causing case_clause exception #7162

Closed
sigsergv opened this issue Apr 25, 2023 · 2 comments
Closed

Not handled response in ets:tab2file causing case_clause exception #7162

sigsergv opened this issue Apr 25, 2023 · 2 comments
Assignees
Labels
team:VM Assigned to OTP team VM
Milestone

Comments

@sigsergv
Copy link
Contributor

In method ets:tab2file there should be one more case for disk_log:open:

        case disk_log:open([{name, Name}, {file, File}]) of
            {ok, Name} ->
                ok;
            {error, Reason} ->
                throw(Reason)
        end,

disk_log:open could also return term {repaired, ... and this causes unhandled case_clause exception in proper ets:tab2file use.

Unfortunately I cannot provide conditions to reproduce but it could be linked to insuffucient memory.

@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label May 2, 2023
@sverker
Copy link
Contributor

sverker commented May 3, 2023

The file is deleted just before disk_log:open is called:

	_ = file:delete(File),
	case file:read_file_info(File) of
	    {error, enoent} -> ok;
	    _ -> throw(eaccess)
	end,
	Name = make_ref(),
	case disk_log:open([{name, Name}, {file, File}]) of
	    {ok, Name} ->
		ok;
	    {error, Reason} ->
		throw(Reason)
	end,

So I guess getting {repaired, ...} must mean someone else has recreated the file in between (like a racing ets:tab2file). What would the expected behavior be then?

@sverker
Copy link
Contributor

sverker commented May 31, 2023

Fix #7237 merged to maint for OTP 26.1.

@sverker sverker closed this as completed May 31, 2023
@sverker sverker added this to the OTP-26.1 milestone May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

3 participants