GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — logging: make flush wait for writes by pongad · Pull Request #1815 · googleapis/google-cloud-java

Conversation

@pongad

@pongad pongad commented Mar 28, 2017

Copy link
Copy Markdown
Contributor

Updates 1795.

This PR still isn't completely correct,
since it does not force any RPC to immediately be issued.
However, flush should now correctly wait for RPCs
representing prior calls to publish to complete
and any failures to be reported to ErrorManager
before returning.

This PR is WIP due to lack of tests.
They are forth-coming,
but all existing tests pass.

Fun fact:
I wrote this PR three times,
using synchronized, ReentrantLock, then Monitor
mirroring the Monitor class's documentation:
http://google.github.io/guava/releases/21.0/api/docs/com/google/common/util/concurrent/Monitor.html

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@pongad
pongad requested review from garrettjonesgoogle and michaelbausor March 28, 2017 07:03
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 28, 2017
michaelbausor
michaelbausor reviewed Mar 28, 2017
View reviewed changes
Comment thread google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java Outdated
}
}
});
flushMonitor.enterWhenUninterruptibly(noFlushers);

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

pongad added 2 commits March 29, 2017 17:12
@pongad
WIP: logging: make flush wait for writes
f2d3c73
Updates 1795.

This PR still isn't completely correct,
since it does not force any RPC to immediately be issued.
However, flush should now correctly wait for RPCs
representing prior calls to publish to complete
and any failures to be reported to ErrorManager
before returning.

This PR is WIP due to lack of tests.
They are forth-coming,
but all existing tests pass.

Fun fact:
I wrote this PR three times,
using `synchronized`, `ReentrantLock`, then `Monitor`
mirroring the Monitor class's documentation:
http://google.github.io/guava/releases/21.0/api/docs/com/google/common/util/concurrent/Monitor.html
@pongad
allow concurrent writes and flushes
af0cbae
@pongad

pongad commented Mar 29, 2017

Copy link
Copy Markdown
Contributor Author

@michaelbausor @garrettjonesgoogle PTAL

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coveralls

coveralls commented Mar 29, 2017

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.005%) to 80.807% when pulling af0cbae on pongad:logging-sync into 38bace4 on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pongad

pongad commented Mar 29, 2017

Copy link
Copy Markdown
Contributor Author

@michaelbausor @garrettjonesgoogle Actually, please hold off. I'm no longer convinced this is right.

Consider the following events:

  • A publish RPC is sent, its future recorded in the table
  • The RPC fails. We invoke a callback, roughly calling callback.onFailure(throwable).
  • Since we only need the callback and the throwable, the future itself might not be needed. The future gets GCed
  • Someone calls flush, since the future is already GCed, flush returns.
  • Then, the callback calls reportError.

Thus, the flush might return before the error could be reported.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pongad
manual set remove
baf2d43
@pongad

pongad commented Mar 29, 2017

Copy link
Copy Markdown
Contributor Author

@michaelbausor @garrettjonesgoogle I hope this is right now. Still needs tests and force-RPC-to-fire thing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coveralls

coveralls commented Mar 29, 2017

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.004%) to 80.798% when pulling baf2d43 on pongad:logging-sync into 38bace4 on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@michaelbausor

michaelbausor commented Mar 29, 2017

Copy link
Copy Markdown
Contributor

Looks good!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

garrettjonesgoogle
garrettjonesgoogle reviewed Mar 29, 2017
View reviewed changes
Comment thread google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java Outdated

@Override
public void flush() {
// BUG(1795): flush is broken, need support from batching implementation.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java Outdated
reportError(null, new Exception(t), ErrorManager.FLUSH_FAILURE);
}
} finally {
onSuccess(null);

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java
pendingWrites.add(writeFuture);
} finally {
writeLock.unlock();
}

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java Outdated
public void flush() {
// BUG(1795): flush is broken, need support from batching implementation.

ArrayList<ApiFuture<Void>> writes = new ArrayList<>();

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pongad
pr comment
5378b39
@coveralls

coveralls commented Mar 30, 2017

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.004%) to 80.806% when pulling 5378b39 on pongad:logging-sync into 38bace4 on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pongad
add test
2b3a7c2
garrettjonesgoogle
garrettjonesgoogle reviewed Mar 30, 2017
View reviewed changes
Comment thread google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingHandlerTest.java
assertTrue(flushWaiter.isAlive());

// With the RPC completed, flush should return, and the thread should terminate.
mockRpc.set(null);

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-logging/src/test/java/com/google/cloud/logging/LoggingHandlerTest.java
});
flushWaiter.start();

// flushWaiter should be waiting for mockRpc to complete.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pongad pongad changed the title WIP: logging: make flush wait for writes logging: make flush wait for writes Mar 31, 2017
@pongad
pr comment
91f3a33
@pongad

pongad commented Mar 31, 2017

Copy link
Copy Markdown
Contributor Author

@garrettjonesgoogle PTAL

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coveralls

coveralls commented Mar 31, 2017

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.02%) to 80.82% when pulling 91f3a33 on pongad:logging-sync into 38bace4 on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@garrettjonesgoogle
garrettjonesgoogle merged commit d726f41 into googleapis:master Mar 31, 2017
@pongad
pongad deleted the logging-sync branch April 3, 2017 04:43
garrettjonesgoogle pushed a commit that referenced this pull request Apr 11, 2017
@rybosome @garrettjonesgoogle
Rebase master (#1900)
05990c8
* updating 'PubSubExample' to latest api (#1808)

* updating pubsub sample to latest api

* Pubsub update (#1818)

* Update GAPIC layer
* Manual updates to support pubsub changes

* Update spi classes (#1817)

* Update README.md (#1825) [ci skip]

* Add DURABLE_REDUCED_AVAILABILITY storage class (#1834)

Otherwise we crash when servers return this value.

* logging: make flush wait for writes (#1815)

This PR still isn't completely correct,
since it does not force any RPC to immediately be issued.
However, flush should now correctly wait for RPCs
representing prior calls to publish to complete
and any failures to be reported to ErrorManager
before returning.

* use new PartitionKey implementation (#1841)

bumping gax version to 0.8.0 for the new implementation.
reflects googleapis/gapic-generator#1153 .

* Release 0.11.0

* Updating version in README files. [ci skip]

* Update version to 0.11.1-SNAPSHOT (#1843)

* Added a missing @test annotation (#1842)

* pubsub: make Subscriber use ApiService (#1824)

Fixes #1761.

* SPI: Adding @experimentalapi back to logging client classes (#1844)

* Bumping NL, Translate to beta (#1848)

* Release 0.11.1

* Updating version in README files. [ci skip]

* Update version to 0.11.2-SNAPSHOT (#1852)

* pubsub: remove obsolete doc references (#1823)

This PR removes references to the deprecated code of the docs.
The emulator section is rewritten.

Fixes #1789.

* adding functions to manage life cycle of resources in ITComputeTest (#1768)

*adding functions to ITComputeTest, in order to make sure resources
created during tests can be properly deleted even if tests fail or
become timed out.
* refactor and incorporate feedbacks
* implement `add` function with compile-time type checking
* add `remove` method to remove a resource from managed resources
* use Id's as handles to resources
* fix copyright header
* rename class name
* modify remove function, pass delete function to each add method
* address comments

* Add Speech v1. (#1858)

* Make logging overrides the default channel provider (#1820)

* Added more unit tests for SessionPool (#1862)

* Rename Translate title to Translation [ci skip] (#1867)

* Release 0.11.2

* Updating version in README files. [ci skip]

* Update pom.xml version to 0.11.3-SNAPSHOT (#1870)

* pubsub: acquire FlowController before releasing (#1831)

* Revert "pubsub: acquire FlowController before releasing (#1831)" (#1872)

This reverts commit 3717ac6.

This change brings up another serious bug.
If the number of messages we pull in one RPC is greater than the number size of the semaphore, we deadlock forever.
Will redo this later.

* pubsub: make deprecated methods package-private (#1861)

add back mistakenly deleted test

Fixes #1828.

* pubsub: rename newBuilder to defaultBuilder (#1873)

Fixes #1853.

* GAE (Flex_Java/Flex_Custom/Flex_Compat/Std_Java8), GCE, GKE testing app for gcj (#1859)

Appengine tests for #1752

* Replace a constant of type Set with ImmutableSet (#1876)

* Language v1beta2 Release (#1878)

* Language v1beta2 Release
* Language v1 update

* Regenerating SPI: use setEndpoint (#1879)

Reflects googleapis/gapic-generator#1172.
Updates #1835.

* remove last use of setPort/setServiceAddress (#1880)

Fixes #1835.

* new code snippet  for push subscription + cleanup of deprecated snippets (#1875)

* cleaning up PubSubExample
adding snippet for creating a subscription with a push endpoint

* updating start, end tags for snippets,
adding async pull snippet tag

* Release 0.12.0

* Updating version in README files. [ci skip]

* Update version to 0.12.1-SNAPSHOT (#1886)

* Update version of google-auth-java to 0.6.1 (#1888)

* Update version of google-auth-java to 0.6.1

Latest version of google-auth-java contains a fix for auth token refresh failures.

* Remove harcoded auth dependencies

* Don't use `UrlFetchTransport` in App Engine Flex environment  (#1893)

* Don't use `UrlFetchTransport` in App Engine Flex environment #1492

* Add annotations to specify GCP launch stage (#1889)

The Google Cloud Platform launch stage
(https://cloud.google.com/terms/launch-stages) is a signifier of the level of
access and support that can be expected of a particular feature. These
annotations will be used to clearly demarcate features as being in a state
other than General Availability to help set user expectations accordingly.

* Add Identity Access Management (IAM) to the Storage API (#1812)

Adds support for bucket-level IAM (currently in limited alpha). More information
about IAM in Google Cloud Storage can be found at
https://cloud.google.com/storage/docs/access-control/iam
meltsufin pushed a commit that referenced this pull request Dec 22, 2025
@cloud-java-bot
chore: Update generation configuration at Thu Jun 5 02:30:55 UTC 2025 (…
591ce2f
…#1815)
chingor13 pushed a commit that referenced this pull request Feb 24, 2026
@lqiu96
feat: Support user defined or json defined scopes for impersonated to…
84fc566
…ken (#1815)

* feat: Support user defined or json defined scopes for impersonated token

* chore: Remove wildcard imports

* chore: Clean up PR

* chore: Create CLOUD_PLATFORM_SCOPE constant in Oauth2Utils

* chore: Fix constant usage in tests

* chore: Fix lint issues
suztomo pushed a commit to suztomo/google-cloud-java that referenced this pull request Mar 11, 2026
@cloud-java-bot
chore: Update generation configuration at Thu Jun 5 02:30:55 UTC 2025 (…
181de4e
…googleapis#1815)
chingor13 pushed a commit that referenced this pull request Mar 12, 2026
@lqiu96
feat: Support user defined or json defined scopes for impersonated to…
135816c
…ken (#1815)

* feat: Support user defined or json defined scopes for impersonated token

* chore: Remove wildcard imports

* chore: Clean up PR

* chore: Create CLOUD_PLATFORM_SCOPE constant in Oauth2Utils

* chore: Fix constant usage in tests

* chore: Fix lint issues
suztomo pushed a commit to suztomo/google-cloud-java that referenced this pull request Mar 23, 2026
@renovate-bot
deps: update dependency com.fasterxml.jackson.core:jackson-databind t…
5b81a8c
…o v2.18.1 (googleapis#1815)
meltsufin pushed a commit that referenced this pull request Apr 29, 2026
@renovate-bot @gcf-owl-bot
chore(deps): update dependency com.google.cloud:google-cloud-pubsub t…
6989630
…o v1.125.11 (#1815)

* chore(deps): update dependency com.google.cloud:google-cloud-pubsub to v1.125.11

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
meltsufin pushed a commit that referenced this pull request May 1, 2026
@renovate-bot @gcf-owl-bot
chore(deps): update dependency com.google.cloud:google-cloud-pubsub t…
627857e
…o v1.125.11 (#1815)

* chore(deps): update dependency com.google.cloud:google-cloud-pubsub to v1.125.11

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
meltsufin pushed a commit that referenced this pull request May 2, 2026
@lqiu96
chore: Add Clirr exemptions for Protobuf 4.27.4+ runtime (#1815)
b667e69
benjaminp pushed a commit to benjaminp/google-cloud-java that referenced this pull request Jul 13, 2026
@suztomo
fix: remove javadoc external link configuration (googleapis#1815)
37177fd
The undefined variable in the external link configuration
fails JDK 17 builds.
benjaminp pushed a commit to benjaminp/google-cloud-java that referenced this pull request Jul 13, 2026
@release-please
chore(main): release 2.24.1 (googleapis#1816)
cf2d968
🤖 I have created a release *beep* *boop*
---


## [2.24.1](https://togithub.com/googleapis/java-bigtable/compare/v2.24.0...v2.24.1) (2023-06-27)


### Bug Fixes

* Remove javadoc external link configuration ([googleapis#1815](https://togithub.com/googleapis/java-bigtable/issues/1815)) ([37177fd](https://togithub.com/googleapis/java-bigtable/commit/37177fd7742f268557a1db3287dc2d7489ed08e3))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers
@garrettjonesgoogle garrettjonesgoogle garrettjonesgoogle left review comments
@michaelbausor michaelbausor michaelbausor left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@pongad @coveralls @michaelbausor @garrettjonesgoogle @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.