ddea47a633bf2cf97c69951467fdb1cc586485f1,lib/streamlit/Connection.py,Connection,_cleanup_on_exit,#Connection#,278
Before Change
LOGGER.debug("Cleanup thread waiting for main thread to end.")
main_thread.join()
FINAL_WAIT_SECONDS = 5
for i in range(FINAL_WAIT_SECONDS):
LOGGER.debug(f"Checking proxy connection status: {self._proxy_connection_status}")
if self._proxy_connection_status == Connection._PROXY_CONNECTION_DISCONNECTED:
LOGGER.debug("Local script started and exited too fast before proxy started. Waiting 1 second...")
time.sleep(1)
elif self._proxy_connection_status == Connection._PROXY_CONNECTION_CONNECTED:
// Sleep for a tiny bit to make sure we flush everything to the proxy.
time.sleep(0.1)
break
elif self._proxy_connection_status == Connection._PROXY_CONNECTION_FAILED:
LOGGER.debug("Proxy connection failed. Ending the local script.")
break
else:
LOGGER.error(f"_proxy_connection_status illegal value: {self._proxy_connection_status}")
break
LOGGER.debug("Main thread ended. Restoring excepthook.")
sys.excepthook = original_excepthook
self._loop.add_callback(setattr, self, "_is_open", False)
LOGGER.debug("Submitted callback to stop the connection thread.")
After Change
"to connect. Exiting.")
break
elif self._proxy_connection_status == Connection._PROXY_CONNECTION_DISCONNECTED:
time.sleep(PROXY_CONNECTION_POLL_INTERVAL_SECONDS)
elif self._proxy_connection_status == Connection._PROXY_CONNECTION_CONNECTED:
// Sleep for a tiny bit to make sure we flush everything to the proxy.
LOGGER.debug("The proxy was connected. Preparing to cleanup.")
time.sleep(FLUSH_QUEUE_SECONDS)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: streamlit/streamlit
Commit Name: ddea47a633bf2cf97c69951467fdb1cc586485f1
Time: 2018-10-12
Author: adrien.g.treuille@gmail.com
File Name: lib/streamlit/Connection.py
Class Name: Connection
Method Name: _cleanup_on_exit
Project Name: ray-project/ray
Commit Name: b71c912da70e307ff1a9f07c7ca277a727306126
Time: 2020-07-05
Author: rliaw@berkeley.edu
File Name: python/ray/tune/examples/mlflow_example.py
Class Name:
Method Name: easy_objective