reugn commented on a change in pull request #108: [Issue #107] SetWriteDeadline
on connection
URL: https://github.com/apache/pulsar-client-go/pull/108#discussion_r352789993
##########
File path: pulsar/internal/connection.go
##########
@@ -309,7 +310,13 @@ func (c *connection) WriteData(data []byte) {
func (c *connection) internalWriteData(data []byte) {
c.log.Debug("Write data: ", len(data))
- if _, err := c.cnx.Write(data); err != nil {
+ err := c.cnx.SetWriteDeadline(time.Now().Add(writeDeadline))
Review comment:
Should be set before each Write.
Connections produced via the connection pool and clients are not aware of
the underlying configuration. Exposing such low-level config is redundant, we
can increase the timeout though.
If a connection got stuck on Write, it will not reach the ping ticker
message. Also, it will not release the Flush WaitGroup
(impl_partition_producer.go: 438).
@merlimat WDYT?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services