kurtisvg
Repos
3
Followers
13

A utility for connecting securely to your Cloud SQL instances

995
295

Code samples used on cloud.google.com

5952
5692

Java and Kotlin Code samples used on cloud.google.com

1495
2603

Events

docs: improve `PredictTextSentimentAnalysisSample`

Looks like it's approved by the language reviewer (me + @Sita04) and just needs to be approved by a product reviewer (@googleapis/cdpe-cloudai)

Created at 1 day ago
hybrid_glossaries.hybrid_tutorial_test: test_create_and_delete_glossary failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and I will stop commenting.


commit: 16ff34177685efd6c59c7f44ac248ca790abdd10 buildURL: Build Status, Sponge status: failed

def retry_target(target, predicate, sleep_generator, deadline, on_error=None):
    """Call a function and retry if it fails.

    This is the lowest-level retry helper. Generally, you'll use the
    higher-level retry helper :class:`Retry`.

    Args:
        target(Callable): The function to call and retry. This must be a
            nullary function - apply arguments with `functools.partial`.
        predicate (Callable[Exception]): A callable used to determine if an
            exception raised by the target should be considered retryable.
            It should return True to retry or False otherwise.
        sleep_generator (Iterable[float]): An infinite iterator that determines
            how long to sleep between retries.
        deadline (float): How long to keep retrying the target. The last sleep
            period is shortened as necessary, so that the last retry runs at
            ``deadline`` (and not considerably beyond it).
        on_error (Callable[Exception]): A function to call while processing a
            retryable exception.  Any error raised by this function will *not*
            be caught.

    Returns:
        Any: the return value of the target function.

    Raises:
        google.api_core.RetryError: If the deadline is exceeded while retrying.
        ValueError: If the sleep generator stops yielding values.
        Exception: If the target raises a method that isn't retryable.
    """
    if deadline is not None:
        deadline_datetime = datetime_helpers.utcnow() + datetime.timedelta(
            seconds=deadline
        )
    else:
        deadline_datetime = None

    last_exc = None

    for sleep in sleep_generator:
        try:
          return target()

.nox/py-3-10/lib/python3.10/site-packages/google/api_core/retry.py:190:


self = <google.api_core.operation.Operation object at 0x7fb2be371960> retry = <google.api_core.retry.Retry object at 0x7fb2be293880>

def _done_or_raise(self, retry=DEFAULT_RETRY):
    """Check if the future is done and raise if it's not."""
    kwargs = {} if retry is DEFAULT_RETRY else {"retry": retry}

    if not self.done(**kwargs):
      raise _OperationNotComplete()

E google.api_core.future.polling._OperationNotComplete

.nox/py-3-10/lib/python3.10/site-packages/google/api_core/future/polling.py:89: _OperationNotComplete

The above exception was the direct cause of the following exception:

self = <google.api_core.operation.Operation object at 0x7fb2be371960> timeout = 90, retry = <google.api_core.retry.Retry object at 0x7fb2be293880>

def _blocking_poll(self, timeout=None, retry=DEFAULT_RETRY):
    """Poll and wait for the Future to be resolved.

    Args:
        timeout (int):
            How long (in seconds) to wait for the operation to complete.
            If None, wait indefinitely.
    """
    if self._result_set:
        return

    retry_ = self._retry.with_deadline(timeout)

    try:
        kwargs = {} if retry is DEFAULT_RETRY else {"retry": retry}
      retry_(self._done_or_raise)(**kwargs)

.nox/py-3-10/lib/python3.10/site-packages/google/api_core/future/polling.py:110:


args = (), kwargs = {} target = functools.partial(<bound method PollingFuture._done_or_raise of <google.api_core.operation.Operation object at 0x7fb2be371960>>) sleep_generator = <generator object exponential_sleep_generator at 0x7fb2bdd02b20>

@functools.wraps(func)
def retry_wrapped_func(*args, **kwargs):
    """A wrapper that calls target function with retry."""
    target = functools.partial(func, *args, **kwargs)
    sleep_generator = exponential_sleep_generator(
        self._initial, self._maximum, multiplier=self._multiplier
    )
  return retry_target(
        target,
        self._predicate,
        sleep_generator,
        self._deadline,
        on_error=on_error,
    )

.nox/py-3-10/lib/python3.10/site-packages/google/api_core/retry.py:283:


target = functools.partial(<bound method PollingFuture._done_or_raise of <google.api_core.operation.Operation object at 0x7fb2be371960>>) predicate = <function if_exception_type..if_exception_type_predicate at 0x7fb2be29d900> sleep_generator = <generator object exponential_sleep_generator at 0x7fb2bdd02b20> deadline = 90, on_error = None

def retry_target(target, predicate, sleep_generator, deadline, on_error=None):
    """Call a function and retry if it fails.

    This is the lowest-level retry helper. Generally, you'll use the
    higher-level retry helper :class:`Retry`.

    Args:
        target(Callable): The function to call and retry. This must be a
            nullary function - apply arguments with `functools.partial`.
        predicate (Callable[Exception]): A callable used to determine if an
            exception raised by the target should be considered retryable.
            It should return True to retry or False otherwise.
        sleep_generator (Iterable[float]): An infinite iterator that determines
            how long to sleep between retries.
        deadline (float): How long to keep retrying the target. The last sleep
            period is shortened as necessary, so that the last retry runs at
            ``deadline`` (and not considerably beyond it).
        on_error (Callable[Exception]): A function to call while processing a
            retryable exception.  Any error raised by this function will *not*
            be caught.

    Returns:
        Any: the return value of the target function.

    Raises:
        google.api_core.RetryError: If the deadline is exceeded while retrying.
        ValueError: If the sleep generator stops yielding values.
        Exception: If the target raises a method that isn't retryable.
    """
    if deadline is not None:
        deadline_datetime = datetime_helpers.utcnow() + datetime.timedelta(
            seconds=deadline
        )
    else:
        deadline_datetime = None

    last_exc = None

    for sleep in sleep_generator:
        try:
            return target()

        # pylint: disable=broad-except
        # This function explicitly must deal with broad exceptions.
        except Exception as exc:
            if not predicate(exc):
                raise
            last_exc = exc
            if on_error is not None:
                on_error(exc)

        now = datetime_helpers.utcnow()

        if deadline_datetime is not None:
            if deadline_datetime <= now:
              raise exceptions.RetryError(
                    "Deadline of {:.1f}s exceeded while calling target function".format(
                        deadline
                    ),
                    last_exc,
                ) from last_exc

E google.api_core.exceptions.RetryError: Deadline of 90.0s exceeded while calling target function, last exception:

.nox/py-3-10/lib/python3.10/site-packages/google/api_core/retry.py:205: RetryError

During handling of the above exception, another exception occurred:

def test_create_and_delete_glossary():
    sys.path.insert(1, "../")
    from translate_v3_delete_glossary import delete_glossary

    languages = ["fr", "en"]
    glossary_name = f"test-glossary-{uuid.uuid4()}"
    glossary_uri = "gs://cloud-samples-data/translation/bistro_glossary.csv"

    # create_glossary will raise an exception if creation fails
  create_glossary(languages, PROJECT_ID, glossary_name, glossary_uri)

hybrid_tutorial_test.py:50:


hybrid_tutorial.py:111: in create_glossary operation.result(timeout=90) .nox/py-3-10/lib/python3.10/site-packages/google/api_core/future/polling.py:132: in result self._blocking_poll(timeout=timeout, **kwargs)


self = <google.api_core.operation.Operation object at 0x7fb2be371960> timeout = 90, retry = <google.api_core.retry.Retry object at 0x7fb2be293880>

def _blocking_poll(self, timeout=None, retry=DEFAULT_RETRY):
    """Poll and wait for the Future to be resolved.

    Args:
        timeout (int):
            How long (in seconds) to wait for the operation to complete.
            If None, wait indefinitely.
    """
    if self._result_set:
        return

    retry_ = self._retry.with_deadline(timeout)

    try:
        kwargs = {} if retry is DEFAULT_RETRY else {"retry": retry}
        retry_(self._done_or_raise)(**kwargs)
    except exceptions.RetryError:
      raise concurrent.futures.TimeoutError(
            "Operation did not complete within the designated " "timeout."
        )

E concurrent.futures._base.TimeoutError: Operation did not complete within the designated timeout.

.nox/py-3-10/lib/python3.10/site-packages/google/api_core/future/polling.py:112: TimeoutError

Created at 3 days ago
CPU hikes and won't come down on cloud-sql-proxy container, sometimes.

@nurfgun Can you write a simple application that reproduces this behavior? As @enocom pointed out above, we're unable to replicate the same behavior, which points to something specific to your situation. If we can repro it, it's a bit easier for us to profile and identify the cause.

Created at 3 days ago
docs: fix Windows URLs

Duplicate of 1559

Created at 3 days ago
chore(deps): update dependency apache-airflow [security]

Looks like dep conflict:

ERROR: Cannot install -r requirements.txt (line 3) because these package versions have conflicting dependencies.

The conflict is caused by:
    apache-airflow 2.4.2 depends on attrs>=22.1.0
    The user requested (constraint) attrs==20.3.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
Created at 1 week ago
Seeing `dial error (timeout: refresh failed: context deadline exceeded)` from time to time

It should work to just get the connection a second time if the first one fails - the 2nd will block on the API request completing.

Created at 1 week ago
com.example.asset.QuickStartIT: testExportAssetBigqueryExample failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and I will stop commenting.


commit: 8f39f249feed513256fc13959157567967ed0b38 buildURL: Build Status, Sponge status: failed

Created at 1 week ago
CPU hikes and won't come down on cloud-sql-proxy container, sometimes.

@nurfgun Have you tried v2 to see if the problem still exists?

Generally CPU usage correlates with network IO - if you application is reading or writing more data you'll see more CPU usage.

Created at 1 week ago