Error: Error: Read packet timeout in DENO

241 views Asked by At

I am running into read packet timeout in deno-mysql. Strangely this happens both in remote and local servers. The servers are ok. Deno is running ok also. But now my issue is when executing a query, initial request will produce an error "Error: Error: Read packet timeout" but surprisingly when requesting for the second time, that is second click. the MySQL query execute as expected.

1

There are 1 answers

6
Sandeep Patel On BEST ANSWER

There is light in the tunnel. I have seen idle-timeout attribute has been added in config. the structure is as below

export interface ClientConfig {
    /** Database hostname */
    hostname ? : string;
    /** Database UNIX domain socket path. When used, `hostname` 
          and `port` are ignored. */
    socketPath ? : string;
    /** Database username */
    username ? : string;
    /** Database password */
    password ? : string;
    /** Database port */
    port ? : number;
    /** Database name */
    db ? : string;
    /** Whether to display packet debugging information */
    debug ? : boolean;
    /** Connection read timeout (default: 30 seconds) */
    timeout ? : number;
    /** Connection pool size (default: 1) */
    poolSize ? : number;
    /** Connection pool idle timeout in microseconds (default: 4 
    hours) */
    idleTimeout ? : number;
    /** charset */
    charset ? : string;
}

Check out deno_mysql or more specifically deno_mysql/pull/81