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

Incorrect error codes lead to Unexpected error (Code: 104) #103

Open
svetlyak40wt opened this issue May 14, 2023 · 3 comments
Open

Incorrect error codes lead to Unexpected error (Code: 104) #103

svetlyak40wt opened this issue May 14, 2023 · 3 comments

Comments

@svetlyak40wt
Copy link

svetlyak40wt commented May 14, 2023

I'm working on improvement of a Woo benchmark at
and discovered, that sometimes Woo logs errors like this:

woo:  <ERROR> [08:11:41] woo.ev.tcp - Unexpected error (Code: 104)

I've dig into the source code and found the place where it logs an error:

Also, I've discovered that Woo defines error codes like this, but on Ubuntu 22.04 they are different. Here in comments I've added results of the grep in header files on my linux virtual machine:

;; /usr/include/asm-generic/errno.h:#define        EWOULDBLOCK     EAGAIN  /* Operation would block */
(defconstant EWOULDBLOCK 35.)
;; correct
(defconstant EPIPE 32.)
;; correct
(defconstant EINTR 4.)
;; /usr/include/asm-generic/errno.h:#define        EPROTO          71      /* Protocol error */
(defconstant EPROTO 100.)
;; /usr/include/asm-generic/errno.h:#define        ECONNABORTED    103     /* Software caused connection abort */
(defconstant ECONNABORTED 53.)
;; /usr/include/asm-generic/errno.h:#define        ECONNREFUSED    111     /* Connection refused */
(defconstant ECONNREFUSED 61.)
;; /usr/include/asm-generic/errno.h:#define        ECONNRESET      104     /* Connection reset by peer */
(defconstant ECONNRESET 54.)
;; /usr/include/asm-generic/errno.h:#define        ENOTCONN        107     /* Transport endpoint is not connected */
(defconstant ENOTCONN 57.)
;; correct
(defconstant EAGAIN 11.)

Should these constants be fixed in Woo sources?

svetlyak40wt added a commit to svetlyak40wt/woo that referenced this issue May 22, 2023
Codes were fixed according to notes from issue:
fukamachi#103
@fukamachi
Copy link
Owner

Thanks for the patch!
Since the error codes are possibly different in other environments like Darwin, so need to look into it.
It may be better to use Grovel to retrieve them.

@svetlyak40wt
Copy link
Author

If you wish, I could try to redo this patch for using groveler.

@fukamachi
Copy link
Owner

Oh, it'd be great if you don't mind. Thanks!

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