Skip to content

remove assertion when trying to re-enable active mode#40

Merged
rawhat merged 2 commits intorawhat:masterfrom
vshakitskiy:assertion-crash
Jan 11, 2026
Merged

remove assertion when trying to re-enable active mode#40
rawhat merged 2 commits intorawhat:masterfrom
vshakitskiy:assertion-crash

Conversation

@vshakitskiy
Copy link
Copy Markdown
Contributor

Closes #39

@karlsson
Copy link
Copy Markdown
Contributor

Should one do actor.continue only for the Ok(Nil) case and actor.stop for the Error(_) case ?

@vshakitskiy
Copy link
Copy Markdown
Contributor Author

Should one do actor.continue only for the Ok(Nil) case and actor.stop for the Error(_) case ?

yep, that is the cleaner approach, the connection is already dead at Error case, so we should stop the actor then!

@rawhat rawhat merged commit b3cafcc into rawhat:master Jan 11, 2026
1 check passed
@rawhat
Copy link
Copy Markdown
Owner

rawhat commented Jan 11, 2026

Makes sense, thank you!

@vshakitskiy vshakitskiy deleted the assertion-crash branch January 11, 2026 08:37
@karlsson
Copy link
Copy Markdown
Contributor

I just wonder...
Now your error case is Error(Nil) which is what is defined for transport.set_opts but the called ffi function in glisten_{ssl,tcp}_ffi.erl seems to return the Erlang error which would be Error(Einval) in this case.
Maybe all the set_opts errors in the ffi modules should be mapped to Nil or that one specifies all possible error types for the set_opts call?

@vshakitskiy
Copy link
Copy Markdown
Contributor Author

I just wonder... Now your error case is Error(Nil) which is what is defined for transport.set_opts but the called ffi function in glisten_{ssl,tcp}_ffi.erl seems to return the Erlang error which would be Error(Einval) in this case. Maybe all the set_opts errors in the ffi modules should be mapped to Nil or that one specifies all possible error types for the set_opts call?

You nailed it, I am receiving lots of crashes now. We are pattern matching on Error(Nil) which is not the case exactly. Internally we don't return {error, nil}!

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.

Handler crashes with einval when TCP connection closes during message processing

3 participants