Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository:rails-sqlserver/tiny_tds
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base:master
Choose a base ref
...
head repository:rails-sqlserver/tiny_tds
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare:test-database-downtime
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 5 commits
  • 12 files changed
  • 3 contributors

Commits on Mar 22, 2021

  1. Configuration menu
    Copy the full SHA
    6368315View commit details
    Browse the repository at this point in the history
  2. Better handling of network related timeouts

    With a working network connection: * command batch is called on non gvl thread * tinytds_err_handler is called with timeout error and returns INT_TIMEOUT * dbcancel is called and command batch returns * nogvl_cleanup is called and timeout error is raised This is all great. The timeout is hit, the db connection lives, and a error is thrown. With a network failure: * command batch is called on non gvl thread * tinytds_err_handler is called with timeout error and returns INT_TIMEOUT * dbcancel is called and does not succeed. command batch never returns * nogvl_cleanup is not called This is not great. dbcancel does not succeed because of the network failure. the command batch does not return until the underlying network timeout on the os is hit. TinyTds doesn't throw an error in the expected timeout window. To fix, we set a flag when a timeout is encountered. We use dbsetinterrupt to check this flag periodically while waiting on a read from the server. Once the flag is set the interrupt with send INT_CANCEL causing the pending command batch to return early. This means nogvl_cleanup will be called and raise the timeout error. This shouldn't have any affect in "normal" timeout conditions due to the fact that dbcancel will actually succeed and cause the normal flow before the interrupt can be called/handled. This is good because in these situtations we still want the dbproc to remain in working condition. Also, update severity assertion to support more freetds versions. Severity level changed with this commit in freetds FreeTDS/freetds@6642360. Since the severity check isn't essential we allow for either severity in order to support a wider range of freetds versions.
    @bvogelzang@aharpervc
    bvogelzang authored and aharpervc committed Mar 22, 2021
    Configuration menu
    Copy the full SHA
    0cbc0a3View commit details
    Browse the repository at this point in the history
  3. Properly report stored procedure errors when using info messages

    - capturing errors while in a non-blocking state was originally structured to capture a single error. This was intentional in order to avoid capturing more generic info messages that FreeTDS might send before the Global VM Lock was obtained. In most circumstances this is what we want. However, now that we capture info messages it is possible that a info message will be stored and the actual runtime error will be discarded as non-important. The result is that while a runtime error is reported in the database, a TinyTds error is never thrown and only the info message is handled. A subset of this problem is that only one info message can be captured while in non-blocking mode which prevents stored procedures from reporting multiple info messages to TinyTds. - to fix this issue, the reported messages are stored within a dynamic array of tinytds_errordata structs, then processed normally once the GVL is obtained. - given the fact that we don't know the number of messages that will be sent, we dynamically manage and re-allocate memory for the nonblocking_errors array as needed. We can't use the ruby C API because it is not safe to call while in a non-blocking state as shown by #133.
    @bvogelzang@aharpervc
    bvogelzang authored and aharpervc committed Mar 22, 2021
    Configuration menu
    Copy the full SHA
    2d198a3View commit details
    Browse the repository at this point in the history
  4. wip: 2.1.4-pre

    @aharpervc
    aharpervc committed Mar 22, 2021
    Configuration menu
    Copy the full SHA
    3202303View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2021

  1. Configuration menu
    Copy the full SHA
    fab9633View commit details
    Browse the repository at this point in the history
Loading