WARNING Connection pool is full, discarding connection: fapi.binance.com - binance

WARNING Connection pool is full, discarding connection: fapi.binance.com
i created a bot with ccxt to create orders.i used multithreading for creating orders function im getting this error.

Related

python3 request POST times out when calling Azure function app

I have a python program that reads a file and posts the data to an Azure function app. Over the past few weeks, I have started noticing this error in the logs. This program is about a year old and has never had an issue like this.
HTTPSConnectionPool(host=xxxx.azurewebsites.net', port=443): Max retries exceeded with url: /api/xxxx?code=zzzzzzzzzzz== (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff96b5f0790>: Failed to establish a new connection: [Errno 110] Connection timed out'))
offending line from program:
response = requests.request("POST", xxxx.azurewebsites.net, json=post_data)
I do not get the error every time.
What could/would cause this issue and how do I correct it?

How to stop tedious connection pool logging

I am using tedious connection pool in my Node js application. Everything is working fine but I see unnecessary logs in console.
How to get rid of these log messages. I want to see logs only if anything fails.
Logs:
Tedious-Connection-Pool: filling pool with 2
Tedious-Connection-Pool: creating connection: 1
Tedious-Connection-Pool: creating connection: 2
Tedious-Connection-Pool: filling pool with 2
You need to change the poolConfig that you pass to new ConnectionPool so that it contains the key log: false
Also see the example in the documentation https://github.com/tediousjs/tedious-connection-pool where log: true appears.

HikariCP multithreading separate connection for each thread

To the folks of the stackoverflow community. I was looking for some help with an issue i am facing with HikariCP connection pooling.
High level:
I am trying to create several threads using a thread pool and my plan is to give each worker thread its own separate connection from the HikariCP, but what HikariCP is doing is that it is sharing a common connection across multiple threads. I am using
public synchronized Connection getConnection() throws SQLException
{
synchronized (dataSource) {
return dataSource.getConnection();
}
}
to retrieve a DB connection. Now when I close a connection, I am seeing issues in other threads saying that the connection got closed and the batch of records that thread is processing get dropped.
Here are the stmts from my log file:
2016-06-08 11:52:11,000 DEBUG [com.boxer.delete.SmartProcessWorker] (pool-1-thread-6:) Closing DB connection ConnectionJavassistProxy(1551909727) wrapping oracle.jdbc.driver.T4CConnection#7b4f840f
2016-06-08 11:52:11,002 DEBUG [com.boxer.delete.SmartProcessWorker] (pool-1-thread-9:) Closing DB connection ConnectionJavassistProxy(1511839669) wrapping oracle.jdbc.driver.T4CConnection#343b8714
2016-06-08 11:52:11,014 ERROR [com.boxer.delete.SmartProcessWorker] (pool-1-thread-5:) SQLException trying to Execute pstmt batch
2016-06-08 11:52:11,014 ERROR [com.boxer.delete.SmartProcessWorker] (pool-1-thread-5:) Connection is closed
java.sql.SQLException: Connection is closed
at com.zaxxer.hikari.proxy.ConnectionProxy.checkClosed(ConnectionProxy.java:275)
at com.zaxxer.hikari.proxy.ConnectionJavassistProxy.commit(ConnectionJavassistProxy.java)
at com.boxer.delete.SmartProcessWorker.processRecords(SmartProcessWorker.java:219)
at com.boxer.delete.SmartProcessWorker.run(SmartProcessWorker.java:174)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Now, can someone help me with how to get a Db connection from hikari datasource which is not apparently being shared by any other thread ?
Short answer: don't do that. JDBC connections are not meant to be shared between threads.
From the author of HikariCP (source):
Multithreaded access to Connections was deprecated in JDBC and is not
supported by HikariCP either.
HikariCP is fast enough that you can obtain a Connection, execute SQL,
and then return it back to the pool many times in the course of a
request.
It is a Best Practice to only hold Connections in local variables,
preferably in a try-with-resources block, or possibly passed on the
stack, but never in a class member field. If you follow that pattern
it is virtually impossible to leak a Connection or accidentally share
across threads.

We are running a map reduce/spark job to bulk load hbase data in One of the environment

We are running a map reduce/spark job to bulk load hbase data in one of the environments.
While running it, connection to the hbase zookeeper cannot initialize throwing the following error.
16/05/10 06:36:10 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=c321shu.int.westgroup.com:2181,c149jub.int.westgroup.com:2181,c167rvm.int.westgroup.com:2181 sessionTimeout=90000 watcher=hconnection-0x74b47a30, quorum=c321shu.int.westgroup.com:2181,c149jub.int.westgroup.com:2181,c167rvm.int.westgroup.com:2181, baseZNode=/hbase
16/05/10 06:36:10 INFO zookeeper.ClientCnxn: Opening socket connection to server c321shu.int.westgroup.com/10.204.152.28:2181. Will not attempt to authenticate using SASL (unknown error)
16/05/10 06:36:10 INFO zookeeper.ClientCnxn: Socket connection established, initiating session, client: /10.204.24.16:35740, server: c321shu.int.westgroup.com/10.204.152.28:2181
16/05/10 06:36:10 INFO zookeeper.ClientCnxn: Session establishment complete on server c321shu.int.westgroup.com/10.204.152.28:2181, sessionid = 0x5534bebb441bd3f, negotiated timeout = 60000
16/05/10 06:36:11 INFO mapreduce.HFileOutputFormat2: Looking up current regions for table ecpdevv1patents:NormNovusDemo
Exception in thread "main" org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=35, exceptions:
Tue May 10 06:36:11 CDT 2016, org.apache.hadoop.hbase.client.RpcRetryingCaller#3927df20, java.io.IOException: Call to c873gpv.int.westgroup.com/10.204.67.9:60020 failed on local exception: java.io.EOFException
We have executed the same job in Titan DEV too but facing the same problem. Please let us know if anyone has faced the same problem before.
Details are,
• Earlier job was failing to connect to localhost/127.0.0.1:2181. Hence only the property hbase.zookeeper.quorum has been set in map reduce code with c149jub.int.westgroup.com,c321shu.int.westgroup.com,c167rvm.int.westgroup.com which we got from hbase-site.xml.
• We are using jars of cdh version 5.3.3.

Kaazing Excel Stock Demo Websocket Connection Failure

I've been trying to get the kaazing stock ticker excel demo working, and I'm running into some problems with the websocket connection. I have my gateway running and the stock feed service seems to be working:
[Stock Feed] Stock Ticker demo connected to tcp://localhost:61616
When I attempt to run the javascript JMS messaging demo, I get the following:
CONNECT: ws://localhost:8001/jms
EXCEPTION: ConnectionFailedException: WebSocket connection failed
It typically takes about 30 seconds to fail. In that time, my current sessions on the kaazing dashboard do spike to 1, so I know the connection is at least being attempted.
The same thing is occurring if I use the simple websocket client chrome extension. In my error logs, I'm seeing:
2016-03-11 11:06:18,723 [New I/O worker #6] INFO [ws://localhost:8001/jms x-kaazing-handshake]
[tcp://[0:0:0:0:0:0:0:1]:52340 http/1.1] - [localhost:8001] "GET /jms?.kl=Y HTTP/1.1 " "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0"
2016-03-11 11:06:19,860 [EagerCP_0-1] WARN Unable to establish JMS Connection due to the following exception: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused: connect
The error is addressed on the kaazing site here: http://kaazing.com/doc/jms/4.0/integration-jms/p_jms_integrate_tshoot.html#problem4 but it doesn't really provide a solution. I would try to implement the "workaround" suggested but I can't find the configuration file. None of the gateway configurations contain the given block of XML.
As a last ditch effort, I attempted to modify the activemq service configuration to include websockets by adding the ws to the transportConnector:
<transportConnectors>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
<transportConnector name="ssl" uri="ssl://0.0.0.0:61617"/>
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
<transportConnector name="websocket" uri="ws://0.0.0.0:61614"/>
</transportConnectors>
Still no luck. What am I missing? It seems like this should work right out of the box...
The issue was a permission level on the activemq.bat load. The connection never actually establish itself because of admin privileges on our networks. I was able to fix it by tweaking our admin rights.
Of course, I never looked at the activemq batch logs which gave me the hint right away.
http://developer.kaazing.com/documentation/jms/4.0/about/setup-guide.html#localhost_install

Resources