-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dashboard should request log streams only when the user gestures to display them #3235
Conversation
…rs to not see what was already written. Fix duplicate logs issue by clearing out the backlog when the last subscriber leaves.
What happens to historical logs? For example, will requesting the console logs for an app show all longs since the app started? (if less than the limit) |
…snap shotted after subscribing to the log. Fix existing tests for new functionality and add an additional test.
56647c5
to
cae7d06
Compare
The "backlog" gets cleared after the last subscriber to a resource leaves. Later, when a "new" subscriber comes along, they are all replayed from DCP because we call So even if no one was subscribed for a while, the whole logs come back once someone does. |
One small race is that starting logs before the container is ready, it won’t show up. Super tight race and I don’t know if it’ll be worth complicating the code but I thought I’d let you know |
Only clear the backlog on containers and executables.
Can you describe this a bit more? When what is starting the logs before the container is ready? |
Move lock out of async iterator.
- Remove count and instead check if the delegate is null to indicate whether there are subscribers or not. - Remove the separate IAsyncEnumerable classes and just use `async IAsyncEnumerable` methods.
Employ a 2nd loop that listens for both "has subscribers" and "logs available".
This didn't turn out to be too bad. I added another loop that joined the "has subscribers" and "logs available" information, and only starts the logs once both are true. |
119d860
to
3de5030
Compare
- Set SingleReader=true on the logInformationChannel. - Add comment and assert that LogsAvailable can only turn true and can't go back to false.
…isplay them (dotnet#3235) Change the AppHost to only subscribe to DCP's logs when there is a subscriber for the logs. Fix dotnet#2789 * Show logs * Remove the "StreamingLogger" because that causes subsequent subscribers to not see what was already written. Fix duplicate logs issue by clearing out the backlog when the last subscriber leaves. * Fix a concurrency issue with the backlog. Ensure the backlog is only snap shotted after subscribing to the log. Fix existing tests for new functionality and add an additional test. * PR feedback Only clear the backlog on containers and executables. * PR feedback. Move lock out of async iterator. * Clean up code. - Remove count and instead check if the delegate is null to indicate whether there are subscribers or not. - Remove the separate IAsyncEnumerable classes and just use `async IAsyncEnumerable` methods. * Fix a race at startup when logs aren't available. Employ a 2nd loop that listens for both "has subscribers" and "logs available". * Simplify ResourceNotificationService.WatchAsync. * Fix test build * Address PR feedback - Set SingleReader=true on the logInformationChannel. - Add comment and assert that LogsAvailable can only turn true and can't go back to false. --------- Co-authored-by: David Fowler <[email protected]>
…isplay them (dotnet#3235) Change the AppHost to only subscribe to DCP's logs when there is a subscriber for the logs. Fix dotnet#2789 * Show logs * Remove the "StreamingLogger" because that causes subsequent subscribers to not see what was already written. Fix duplicate logs issue by clearing out the backlog when the last subscriber leaves. * Fix a concurrency issue with the backlog. Ensure the backlog is only snap shotted after subscribing to the log. Fix existing tests for new functionality and add an additional test. * PR feedback Only clear the backlog on containers and executables. * PR feedback. Move lock out of async iterator. * Clean up code. - Remove count and instead check if the delegate is null to indicate whether there are subscribers or not. - Remove the separate IAsyncEnumerable classes and just use `async IAsyncEnumerable` methods. * Fix a race at startup when logs aren't available. Employ a 2nd loop that listens for both "has subscribers" and "logs available". * Simplify ResourceNotificationService.WatchAsync. * Fix test build * Address PR feedback - Set SingleReader=true on the logInformationChannel. - Add comment and assert that LogsAvailable can only turn true and can't go back to false. --------- Co-authored-by: David Fowler <[email protected]>
…isplay them (#3235) (#3343) Change the AppHost to only subscribe to DCP's logs when there is a subscriber for the logs. Fix #2789 * Show logs * Remove the "StreamingLogger" because that causes subsequent subscribers to not see what was already written. Fix duplicate logs issue by clearing out the backlog when the last subscriber leaves. * Fix a concurrency issue with the backlog. Ensure the backlog is only snap shotted after subscribing to the log. Fix existing tests for new functionality and add an additional test. * PR feedback Only clear the backlog on containers and executables. * PR feedback. Move lock out of async iterator. * Clean up code. - Remove count and instead check if the delegate is null to indicate whether there are subscribers or not. - Remove the separate IAsyncEnumerable classes and just use `async IAsyncEnumerable` methods. * Fix a race at startup when logs aren't available. Employ a 2nd loop that listens for both "has subscribers" and "logs available". * Simplify ResourceNotificationService.WatchAsync. * Fix test build * Address PR feedback - Set SingleReader=true on the logInformationChannel. - Add comment and assert that LogsAvailable can only turn true and can't go back to false. --------- Co-authored-by: David Fowler <[email protected]>
Change the AppHost to only subscribe to DCP's logs when there is a subscriber for the logs.
Fix #2789
Microsoft Reviewers: Open in CodeFlow