Comments (11)
Hi @egorsmkv thanks for the bug report!
I believe I see the issue in the library, I do not return the error in Dial if authentication is unsuccessful.
I will fix this oversight shortly and test this error condition to ensure it's working properly.
from eslgo.
I will open another issue tracking this feature request and I will get it added in for the next release. Thanks @egorsmkv!
from eslgo.
Thanks, I wait to test it as well.
from eslgo.
@egorsmkv I have created what should fix this issue in #6 I have also created a release candidate tag for easier testing by yourself. You can switch to v1.3.3-rc
to verify if it is working as expected.
I personally used this example to confirm things are working as intended:
https://github.com/percipia/eslgo/blob/close_fix/example/events/events.go
from eslgo.
Now, it closes as intented but now I am getting a randomized panic:
INFO[0003] Inbound Connection Disconnected
ERRO[0010] failed to auth Content-Type: []string{"command/reply"}
Reply-Text: []string{"-ERR invalid"}
panic: send on closed channel
goroutine 16 [running]:
github.com/percipia/eslgo.(*Conn).receiveLoop(0xc000090a20)
/root/gopath/pkg/mod/github.com/percipia/[email protected]/connection.go:250 +0x299
created by github.com/percipia/eslgo.newConnection
/root/gopath/pkg/mod/github.com/percipia/[email protected]/connection.go:67 +0x53a
from eslgo.
@egorsmkv It looks like this uncovered an underlying issue that wasn't shown due to the connection never exiting. I have pushed 1.3.3-rc2
that resolves this panic.
from eslgo.
It seems the issue is still here:
INFO[0019] Inbound Connection Disconnected
ERRO[0022] failed to auth Reply-Text: []string{"-ERR invalid"}
Content-Type: []string{"command/reply"}
panic: send on closed channel
goroutine 53 [running]:
github.com/percipia/eslgo.(*Conn).receiveLoop(0xc000158240)
/root/gopath/pkg/mod/github.com/percipia/[email protected]/connection.go:252 +0x2b9
created by github.com/percipia/eslgo.newConnection
/root/gopath/pkg/mod/github.com/percipia/[email protected]/connection.go:67 +0x53a
from eslgo.
Hi @egorsmkv
I resolved the race condition being caused by the early shutdown due to auth. Thank you for finding it, I'm sure we would've been bitten by it at some point in the future. Can you try 1.3.3-rc3
to verify that the issue is indeed gone for good this time?
from eslgo.
Now it properly works! Thank you, Andrew!
I just noticed that when the connection is closing here appears this error:
Error receiving message read tcp 127.0.0.1:50022->127.0.0.1:8021: use of closed network connection
and thisL
Failed to auth &{%!e(string=write) %!e(string=tcp) %!e(*net.TCPAddr=&{[127 0 0 1] 50026 }) %!e(*net.TCPAddr=&{[127 0 0 1] 8021 }) %!e(*errors.errorString=&{use of closed network connection})}
Is this normal?
from eslgo.
I'm glad to hear it! Thank you for raising the issue!
Those messages are normal around the shutdown of the connection. They are printed to the log just in case to help trace if there are any issues. I could potentially add in an option to either redirect the logging messages to a supplied logger or to quiet the internal library logs messages.
You can see where they happen here:
https://github.com/percipia/eslgo/blob/close_fix/connection.go#L243
https://github.com/percipia/eslgo/blob/close_fix/inbound.go#L68
from eslgo.
Yes, the ability to set own logger would be so useful!
I am using logrus inside my project so I can suppress these messages by setting the logging level.
from eslgo.
Related Issues (10)
- Automatic reconnection if there is a lost connection HOT 2
- Long running ESL connections unable to send commands HOT 6
- Response with content type "text/rude-rejection" freezes opts.Dial function HOT 1
- Outbound connection write timeout after capturing DTMF digits HOT 5
- Event listeners by Event Name support?
- Multiple Freeswitch Support
- Outbound connection setting "linger" is invalid, and often "CHANNEL_HANGUP_COMPLETE" or other events are not received HOT 2
- HI, I would like to confirm something about the setting of origination_uuid
- Allow setting a custom logger HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslgo.