[CONC-215] async api (connect) kill thread silently if connect failed. Created: 2016-11-19  Updated: 2016-11-19

Status: Open
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 2.3.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Sewon Park Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None
Environment:

windows x64



 Description   

below code from libmariadb.c, 2095 line, mthd_my_real_connect

error:
  reset_sigpipe(mysql);
  DBUG_PRINT("error",("message: %u (%s)",net->last_errno,net->last_error));
  {
    /* Free alloced memory */
    end_server(mysql);
    /* only free the allocated memory, user needs to call mysql_close */
    mysql_close_memory(mysql);
    if (!(((ulong) client_flag) & CLIENT_REMEMBER_OPTIONS))
      mysql_close_options(mysql);
  }
  DBUG_RETURN(0);

if this function fails, if you don't set CLIENT_REMEMBER_OPTIONS,
mysql_close_options called.
in mysql_close_options, my_context_destroy called, and DestroyFiber called on windows.
if fails occured on mysql_real_connect_cont (on coroutine) ... current thread will be gone.

resolve:
1. use CLIENT_REMEMBER_OPTIONS flag.
2. do not call mysql_close_options on mthd_my_real_connect. cleanup should be outside of coroutine.


Generated at Thu Feb 08 03:03:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.