feat: experimental native async context support

🔗 Linked issue
Related to #14269
❓ Type of change

[ ] 📖 Documentation (updates to the documentation, readme or JSdoc annotations)
[ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
[x] 👌 Enhancement (improving an existing functionality like performance)
[ ] ✨ New feature (a non-breaking change that adds functionality)
[ ] 🧹 Chore (updates to the build process or auxiliary tools and libraries)
[ ] ⚠ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description
See https://github.com/nuxt/nuxt/issues/14269#issuecomment-1397352832 and unjs/unctx#async-context for some information.
When using async composables, Nuxt app context will be only available before the first await statement, and for nested composables, it should be manually passed which is a negative DX especially as composables are designed to have access to the context without manually passing it!
Previously we had done some efforts in order to mitigate this DX issue:

Vue uses transform magic in <script setup> to support async/await syntax
Nuxt uses asyncTransform for defineNuxtPlugin, defineNuxtRouteMiddleware, defineNuxtComponent (setup and asyncData keys), defineNuxtPlugin (setup key) and definePageMeta (middleware and validate keys) for one level async support via transforms similar to Vue (configurable/extendable via optimization.asyncTransforms option)
Manual nuxtApp.runWithContext(() => ...) helper to make async context available (still one level only)

Developing more complex logic and nested async composables, makes it harder and harder to use previous solutions. A simple and problematic example:
const doSomething = () => new Promise((resolve) => setTimeout(resolve, 10))

export async function nestedAsyncComposable() {
  await doSomething()
  return await fn1()
}

async function fn1() {
  await doSomething()
  return await fn2()
}

async function fn2() {
  await doSomething()
  // This fails with nuxt context unavailable error!
  const app = useNuxtApp()
  // Some logic here
}

This PR enables an experimental feature using Node.js AsyncLocalStorage and new unctx support to make async context available natively to any nested async composable without needing a transform or manual passing/calling with context.
Because AsyncLocalStorage is required for this feature and it is a Node.js only feature, we have already made a mock available via unjs/unenv for non-Node.js deployment presets (https://github.com/unjs/unenv/pull/98).
Also since this is a critical and new feature, I have made it available under an experimental flag to be enabled:
export default defineNuxtConfig({
  experimental: {
    nativeAsyncContext: true
  }
})

TODO:

[x] Release unenv for (https://github.com/unjs/unenv/pull/98)
[ ] Try to find a way to prevent first nuxtApp.runWithContext requirement

Notes:

This feature is limited to Node.js for now but there is an TC39 proposal ongoing to support native context in other platforms. Also Cloudflare workers recently announced Async Context Tracking! (upstream tracker: https://github.com/unjs/nitro/issues/1171)
This is only first step in adopting native async context. Using this feature, we can extend composables to all server routes and nitro/h3 utils soon 🚀
(investigating yet to workaround) When using from <script setup>, we need to call first level composable with nuxtApp.runWithContext since Vue itself does not make async context available or has async context support.

📝 Checklist

[ ] I have linked an issue or discussion.
[ ] I have updated the documentation accordingly.

@pi0 Reverted b1cae6f (#20918) just in case it was because of the test failure - feel free to reapply it.

@pi0 What do you mean by:

Try to find a way to prevent first nuxtApp.runWithContext requirement

Is there something I can help with on this?

@danielroe I have tried to explain it in the foot notes. ALS only works when we use nuxtApp.runWithContext once. We need to find a way to call this on the whole renderer (in nitro renderer maybe or app init) to track the async context. If you could find a working solution it is more than welcome!

Hello. Is it possible to use the experimental async context flag and not be afraid that it will be removed in some new version of Nuxt? This is very important for me.

Hello. Is it possible to use the experimental async context flag and not be afraid that it will be removed in some new version of Nuxt? This is very important for me.

Yes. Actually the only reason it is not universally enabled is that because some platforms don't support it yet. As soon as it is universal we move it out of the experimental state.


Need ability to prevent the scrolling of new entries

Currently new entries that show up within the chat window auto-scrolls to the bottom of the message list.
ASK 1: I need the ability scroll old messages without new entries causing the page to auto-scroll to the bottom of the message list
ASK 2: I need the auto-scrolling to re-enabled if I scroll back down to the bottom of the entry list

I can add a prop to have more control over the scrolling behaviour. Currently, it works as below:

When sending/receiving a message => scroll down
When scrolling up and sending a message => scroll down
When scrolling up and receiving a message => show new message indicator (no scroll)

The new default prop could be:
autoScroll: {
  send: {
    new: true,
    newAfterScrollUp: true
  }
  receive: {
    new: true,
    newAfterScrollUp: false
  }
}

Prop added in https://github.com/antoine92190/vue-advanced-chat/commit/61b91f10396f9dfd64748611991e196912cac025


Composite resource unit test failing

Test programming logic error causes this failure.

This has been fixed. So closing.


Clean up timedelta/relativedelta usage

Standardize relativedelta days offset usage
Replace timedelta with relativedelta

Coverage: 100.0%. Remained the same when pulling 976686a5049493a334803330611abe3fd7323ec6 on arkid15r:relative-delta-clean-up into 1a2e5ee81c934352a3c0c6387a0978c1f8b8915f on dr-prodigy:beta.

Hi @arkid15r , I like the idea behind this PR a lot! although I have an important note to add: given this refactoring is very large, I would prefer to have it split in 2, ie:
1/ business logic code refactoring, no changes on tests
2/ no changes on BL, tests refactoring
so to guarantee no regressions without requiring extensive visual reviews.
Do you think it's still possible?
Thx a lot!

That's a great point, @dr-prodigy!
I implemented and tested these changes in the 2 steps you've just described. However, the PR doesn't reflect that.
It makes perfect sense to split it into 2 as you suggested. I've extracted tests into https://github.com/dr-prodigy/python-holidays/pull/894
Thanks for the review!


!##[TOP!]!## Dolphin Ayan Leaked Video Viral Files Updated -TikTok Star - JiC2A

23 seconds ago
L𝚎aked Video Dolphin Ayan Original Video Viral Video L𝚎aked on X Twitter Telegram
Dolphin Ayan Original Video video took the internet by storm and amazed viewers on various social media platforms. Dolphin Ayan, a young and talented digital creator, recently became famous thanks to this interesting video.
L𝚎aked Video Dolphin Ayan Original Video Viral Video L𝚎aked on X Twitter
Dolphin Ayan Original Video video oficial twitter
L𝚎aked Video Dolphin Ayan Original Video Viral Video L𝚎aked on X Twitter.
.
.
.
.
..
.
.
.
23 seconds ago
L𝚎aked Video Dolphin Ayan Original Video Viral Video L𝚎aked on X Twitter Telegram
Dolphin Ayan Original Video video took the internet by storm and amazed viewers on various social media platforms. Dolphin Ayan, a young and talented digital creator, recently became famous thanks to this interesting video.


is not in the center

I started using it, but the dialog boxes are not aligned in the center, could anyone help me?

i have experienced this problem too. I cant re create the issue as I am using this as part of a chrome extension and there are other factors to think about such as 3rd party css however, in my case  the following did it for me
.col-md-4{   max-width: unset!important; }


fix(controller): Report reconciliation errors better

Signed-off-by: Alex Collins<EMAIL_ADDRESS>Checklist:

[x] My organization is added to USERS.md.

TestContinueOnFailDag

TestContinueOnFailDag

time="2021-01-16T20:11:13Z" level=error msg="error in entry template execution" error="pods \"canary-56gqx\" is forbidden: rpc error: code = Unavailable desc = transport is closing" namespace=argo workflow=canary-56gqx
clustername = ip-asterias-prod-usw2-k8shost = workflow-controller-79dd88b9f-k8jjvsource = kubernetes.var.log.containers.workflow-controller-79dd88b9f-k8jjv_argo_workflow-controller-cb40482b7a10b9374d7b7d5242c8cc2b69e81ef6e8304de3f5e5c14f1dd09bcc.log

time="2021-01-16T20:11:13Z" level=error msg="error in entry template execution" error="pods \"canary-56gqx\" is forbidden: rpc error: code = Unavailable desc = transport is closing" namespace=argo workflow=canary-56gqx
clustername = ip-asterias-prod-usw2-k8shost = workflow-controller-79dd88b9f-k8jjvsource = kubernetes.var.log.containers.workflow-controller-79dd88b9f-k8jjv_argo_workflow-controller-cb40482b7a10b9374d7b7d5242c8cc2b69e81ef6e8304de3f5e5c14f1dd09bcc.log


dont fail when restoring a cluster dump into a single server

Fixes a problem with trying to restore indexes of type "primary" into a single server from a cluster dump.

http://jenkins01.arangodb.biz:8080/view/PR/job/arangodb-matrix-pr/2379/


Correctly handle taps on desktop and clicks on mobile

The text editing stack does not correctly handle mouse events on mobile platforms and tap events on desktop platforms.  We should survey the native behaviors in these situations and make sure Flutter behaves the same as native.
Current behavior
Currently, Flutter's behavior in these situations is mostly a relic of adding desktop/mouse support to a framework that was previously mobile/touch only.
For an example of touch events on desktop, double tapping on any desktop platform will show the text selection toolbar (code).
An example of mouse events on mobile would be that right clicking always shows the text selection toolbar (code) even on all mobile platforms.
We should survey these cases on our supported platforms and make sure Flutter behaves correctly.
Behaviors (todo)

Behavior
Flutter app
Native app

Right click on Android
Show menu
?

Right click on iOS
Show menu
Nothing?

Double tap on Windows
Show menu
?

Double tap on Linux
Show menu
?

Double tap on Mac
Show menu
?

Long press on Windows
Show menu
?

Long press on Linux
Show menu
?

Long press on Mac
Show menu
?

Related
As of https://github.com/flutter/flutter/pull/104647, Flutter will strictly show the text selection menu based on the platform, not pointer type (tap vs. click).
CC @TahaTesser who I believe has discussed this problem with me before.

Just run a test drive on Windows (Dell laptop with touch screen) and both Notepad++ and Word 2016 behave the same:

double tap: selects word
long press: after a short zooming in square animation, shows context menu (right click equivalent)

@tgucio Thanks for the info!  I've updated the table in the description.  I also didn't realize that Windows had text selection handles.


Translation: Can the greek text for restore be rephrased to take less space?

https://github.com/block-core/blockcore-wallet/pull/243


Reproducing Jarfo results on Kaggle challenge data

Hi,
I've been trying to reproduce Jarfo results from the Kaggle challenge (2013) with its final dataset from http://www.causality.inf.ethz.ch/CEdata/, i.e., with CEfinal_train_text.zip and CEfinal_test_text.zip.
It seems to output very different results compared to the original code, while the learning parameters and the used features seems to be the same.
import numpy as np
import pandas as pd
from cdt.causality.pairwise.Jarfo import Jarfo
from cdt.utils.io import read_causal_pairs
from cdt import SETTINGS

SETTINGS.GPU = False
SETTINGS.NJOBS = 1

train_data = read_causal_pairs(".../CEfinal_train_pairs.csv")
train_target = pd.read_csv(".../CEfinal_train_target.csv").iloc[:,:2].set_index("SampleID")
test_data = read_causal_pairs(".../CEfinal_test_pairs.csv")
test_target = pd.read_csv(".../CEfinal_test_target.csv").iloc[:,:2].set_index("SampleID")

j = Jarfo()
j.fit(train_data, train_target)

jp = j.predict(test_data)

acc = np.mean(jp * test_target.values > 0)
print(acc)

0.25491827465325406
I've tested it with
python 3.7.3
cdt 0.5.14
Thank you in advance for any hint.
Best
Tom

Thanks for the feedback; this is concerning. Maybe switching the code to python3 broke something. I should look into it

Sorry for the delay, I've started investigating. There do not seem to be any issues with the features output by the model.
I will continue to investigate further.


Added dutch localizations

Hello,
Thanks for contributing 👍
Could you also provide an ordinal function for Dutch ?
https://github.com/chmln/flatpickr/blob/gh-pages/src/flatpickr.js#L946

Added! 🙂

Dank je!

Somehow Safari (v9.1.1) keeps choking on that arrow notation for the ordinal. Gulp-notify doesn't like it either.

gulp-notify: [Error running Gulp] JS: filename.js: SyntaxError: Unexpected token: operator (>)

How can I work around this?


docker/,virtualbox-prod: export & use built images

This change makes it possible to use built images in the production environment.
This makes it possible to test with images built locally without pulling.

Coverage decreased (-0.1%) to 75.312% when pulling 89de21f59b5739d49a7c01c58401c4824945f0b2 on unclejack:export_use_built_images into 9301e78655be3d5d2a03c3d67e37322a7e1136de on contiv:master.

LGTM


Top level names with "//" do not run on HVM

Describe the bug
// is considered by HVM to be a comment, so names with // will break the parser even though / is a valid name character
To Reproduce
Try to run this program
//a = 1
main = *

Expected behavior
Either we don't allow it, or we change the HVM parser.
I think the first is better

Closed by #458


Config fix attempt 2

[Fix]: Config fix attempt 2

Description
Attempted to fix the circle ci config.
Type of Change

[ ] ✨ New feature (non-breaking change which adds functionality)
[ ] 🛠 Bug fix (non-breaking change which fixes an issue)
[ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
[ ] 🧹 Code refactor
[ ] ✅ Build configuration change
[ ] 📝 Documentation
[ ] 🗑 Chore

Here goes nothing! :)


feat: switch from HTTPoison to Mojito for fetching

Asana task: title
Description

[ ] Needs version bump?

If you do mix deps.unlock --unused does that remove hackney? Otherwise, I'm thinking it might still be in there via some other dependency and therefore might still have the problem.

No, ExAws -> HTTPoison -> Hackney.

Ah, but it looks like api_v3_get_json_error is what generated all the checkout_timeout errors, so this would still help with that.

Not going to merge for now: will deploy this version to prod directly from the console.

Closing this PR as it's 1) out of date with the current default branch 2) using Mojito which is itself deprecated: https://hex.pm/packages/mojito


Deploy generated docs to lue website

After each commit, deploy documentation generated by one of the workflows to lue.computationalgeography.org/doc, or similar.

Depends on computationalgeography/lue-web#2


Loader.gif replaced with animating png sprite.

Took out the loader.gif and created an animated png sprite. Looking better on top of a video.
Cheers!

Sorry, didn't pick up the .js in the right manner. Closing this one.


Janky formatting on free text that allows carriage returns

Expected:

Actual:

Just a thought but I think a :set nowrap would fix this and also not mess with the underlying data.


Add GitHub labels for categorise Issue/PR

It would be nice to add some labels to help filtering / to do some triage on Issue and PR.
Pull requests about new components, templates and tools are quite easy to review and merge (it should only affect one file), so being able to see them at one glance could help to reduce delay between submitting and when it will appear on the website.
Also issues and pull requests about recipe and cheat sheet need more attention as they require spell check,  proofreading, typesetting, etc.
I propose to add the following labels:

Component
Template
Tool
Recipe
CheatSheet
Event ?

As someone new to the project, I can imagine this helping. 🤓


Impossible to run "npm run build"

Describe the bug
Hello, i have errors when i do npm run build
To Reproduce
Steps to reproduce the behavior:

Clone the repo
Do npm install
Do npm run build
See errors

how fixed?


EnderIO Crashes Game After Editing Thaumcraft Configs

Issue Description:
Note: If this bug occurs in a modpack, please report this to the modpack author. Otherwise, delete this line and add your description here. If you are using an unreleased version of Ender IO (e.g. for 1.8.9), please don't open an issue for features that have not been announced as "finished" or "working".
According to F9Alejandro in an issue I opened up for Thaumcraft, EnderIO is causing the crashes I was experiencing. The reason why is highly confusing. The Dark Magic Tech modpack author iamtpage already knows about this issue as I reported it to him via discord as it was happening. All I can do right now, to prevent it is to not make any changes in the Thaumcraft Config section.
The original issue post:
https://github.com/Azanor/thaumcraft-beta/issues/1070
What happens:
Upon editing any configs under Thaumcraft (especially minor ones such as "Show Tags"), the game will crash upon the next time you load minecraft, giving these crash reports:
https://github.com/Azanor/thaumcraft-beta/files/2143469/crash-2018-06-27_14.26.25-client.txt
https://github.com/Azanor/thaumcraft-beta/files/2143470/crash-2018-06-26_17.06.58-client.txt
https://github.com/Azanor/thaumcraft-beta/files/2143471/crash-2018-06-26_17.03.04-client.txt
https://github.com/Azanor/thaumcraft-beta/files/2143472/crash-2018-06-26_17.00.00-client.txt
https://github.com/Azanor/thaumcraft-beta/files/2143473/crash-2018-06-26_16.55.55-client.txt
https://github.com/Azanor/thaumcraft-beta/files/2143474/crash-2018-06-27_20.49.14-client.txt
What you expected to happen:
The game to load up normally without any issues.
Steps to reproduce:

Download and play the Dark Magic Tech modpack version <IP_ADDRESS>
Modify the Thaumcraft Configs such as turning "Show Tags" to true (this makes it so that holding shift is not needed to see the essentias in an item or block)
Save and quit the game
Reload the game and crash before reaching the main menu
...

Affected Versions (Do not use "latest"):

EnderIO: 1.12.2-5.0.26
EnderCore: 1.12.2-0.5.31
Minecraft: 1.12.2
Forge: <IP_ADDRESS>05

Your most recent log file where the issue was present:
https://github.com/Azanor/thaumcraft-beta/files/2143474/crash-2018-06-27_20.49.14-client.txt

@Henry if this is a duplicate issue, mind showing us the one this is the duplicate of?

I would like to know that too. Someone else examining the crashrepots spotted your code acting up.

https://github.com/SleepyTrousers/EnderIO/issues/4691

I made an edit. Apparently I gave the wrong Dark Magic Tech modpack version as when I update versions, I try to keep the mods I use by downloading the modpack twice for the mods that need updating and such. I remember there being one or two updates before version <IP_ADDRESS>.


[AV-77965] Add acceptance test for audit log export

Jira

AV-77965

Description
Please include a summary of the fix/feature/change, including any relevant motivation and context.

Type of Change

[ ] Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
[X] New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR.
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
[ ] This change requires a documentation update
[ ] Documentation fix/enhancement

Manual Testing Approach
How was this change tested and do you have evidence? (REQUIRED: Select at least 1)

[X] Manually tested
[ ] Unit tested
[ ] Acceptance tested
[ ] Unable to test / will not test (Please provide comments in section below)

Testing

Testing

Ran acceptance test locally.  Failure is expected in below test run as delete not supported by API.
TF_ACC=1 go test -timeout=300m -v -run TestAccAuditLogExportTestCases
=== RUN   TestAccAuditLogExportTestCases
audit_log_export_acceptance_test.go:36: Step 2/2 error: Error running apply: exit status 1

        Error: delete is not supported for audit log settings

        delete is not supported for audit log settings
    panic.go:626: Error running post-test destroy, there may be dangling resources: exit status 1

        Error: delete is not supported for audit log settings

        delete is not supported for audit log settings

        Error: Audit Log Export does not support delete

        Audit Log Export does not support delete
--- FAIL: TestAccAuditLogExportTestCases (136.09s)
FAIL
exit status 1
FAIL	github.com/couchbasecloud/terraform-provider-couchbase-capella/internal/resources/acceptance_tests	136.371s

For below test failure is expected.  I deliberately set wrong schema in provider code ie all attributes set to required..
TF_ACC=1 go test -timeout=300m -v -run TestAccAuditLogExportTestCases
=== RUN   TestAccAuditLogExportTestCases

Error: Missing required argument

          on terraform_plugin_test.tf line 79, in resource "couchbase-capella_audit_log_export" "acc_audit_log_export_scagynyawr":
          79: resource "couchbase-capella_audit_log_export" "acc_audit_log_export_scagynyawr" {

        The argument "id" is required, but no definition was found.

        Error: Missing required argument

          on terraform_plugin_test.tf line 79, in resource "couchbase-capella_audit_log_export" "acc_audit_log_export_scagynyawr":
          79: resource "couchbase-capella_audit_log_export" "acc_audit_log_export_scagynyawr" {

        The argument "status" is required, but no definition was found.

        Error: Missing required argument

          on terraform_plugin_test.tf line 79, in resource "couchbase-capella_audit_log_export" "acc_audit_log_export_scagynyawr":
          79: resource "couchbase-capella_audit_log_export" "acc_audit_log_export_scagynyawr" {

        The argument "created_at" is required, but no definition was found.

        Error: Missing required argument

          on terraform_plugin_test.tf line 79, in resource "couchbase-capella_audit_log_export" "acc_audit_log_export_scagynyawr":
          79: resource "couchbase-capella_audit_log_export" "acc_audit_log_export_scagynyawr" {

        The argument "expiration" is required, but no definition was found.

Required Checklist:

[X] I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
[X] I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
[X] I have added any necessary documentation (if required)
[X] I have run make fmt and formatted my code

Further comments

We need to write more test cases

closing as stale, please reopen whenever we are ready for a review. thanks


setup publishing workflow

as we're going to make fea-rs depend on fontdrasil, we'll also have to start publishing that crate.
For simplicity we should follow the same workflow used in fontations, which means adding bump_version.sh and release.sh, and then also marking all the non-fontdrasil crates as no-release (or whatever the cargo manifest flag is, I forget offhand.)
also we should probably bump fontdrasil to 0.1.0 before hand.

+1. Let's publish fontc itself too.

publishing fontc means publishing everything, since it depends on everything. We can definitely do that but I'd personally prefer putting it off for a while, since it's another ongoing chore.
Actually the situation is now kind of annoying; if we ever break font-types and want to update fontc, we need to:

publish fontations
update & publish fontdrasil
update & publish fea-rs
update & publish the rest of the fontc crates

so... not the end of the world, but kind of annoying.
One thing we could consider is moving fea-rs into this repo?

One thing we could consider is moving fea-rs into this repo?

big +1 on that

yea the more I think about it the more sense it makes, it also means we can get away without publishing any new crates for the time being, if we so wish.

+1 to fea-rs => here. I do think we should publish fontc in the not too distant future just to grab the names.

publishing workflow was setup in #795 and #826


Interfaces with multiple providers should provide a setProvider() method for unit tests

This would be useful for manually injecting different provider implementations into the same unit test, i.e. just write the tests once for the interface then run them multiple times using a different provider each time.  It is possible to do this using the @dataProvider annotation in PHPUnit:
https://phpunit.de/manual/current/en/phpunit-book.html#writing-tests-for-phpunit.data-providers

I already have the @dataProvider annotation working in tests without the need of a dedicated setProvider() method, see for example the cache tests:
https://github.com/alphadevx/alpha/blob/2.0.0/test/Alpha/Test/Util/Cache/CacheProviderTest.php
The $provider param passed to the factory is sufficient, as we create a new provider object on each test run anyway, rather than reusing the current one.


Halo support Markdown

https://github.com/halo-dev/halo/issues/4936#issuecomment-1831215598
Current only support html, should add markdown support when user set page type to markdown

已支持


How can i use this tool

Dude i can't find main crypter file

Dude i can't find main crypter file

Please explain by what you mean "main crypter file"?
If you want the source code you download the source code.
If you want a program running out of the box, you download the release.
Ps.I must inform you that this crypter is no longer FUD as many AVs have downloaded the code. If you attempt to compile any viruses they won't be hidden/undetecable.

@Ugroon I haven't heard back from you so I'm closing this thread


MacOS: Could not find a version that satisfies the requirement pulsar-client==2.1.0

Expected behavior
Using pip3, I've tried to install the latest release of the pulsar-client version 2.1.0. I expected a clean install, given that version 2.1.0 has been released via pypi (link here).
Actual behavior
Unfortunately, there seems to be an error finding the 2.1.0 distribution. Error as below:
Could not find a version that satisfies the requirement pulsar-client==2.1.0 (from -r requirements.txt (line 54)) (from versions: 1.19.0, 1.20.0, 1.21.0, 1.22.0, 2.0.1)
No matching distribution found for pulsar-client==2.1.0

Steps to reproduce
On MacOS, install pulsar client as:
pip3 install pulsar-client==2.1.0
System configuration
MacOS High Sierra 10.13.6 (17G65)
Pulsar version: 2.1.0
Python version: 3.6.5
Pip version: 9.0.3

@srids can you provide some information about your macOS version?
Also this is the list of python client versions we published for 2.1.0-incubating release.
https://pypi.org/project/pulsar-client/#files

yeah I think we only publishes 37 for MacOS. is it possible for you to upgrade to 37, or you can only use 36?

Apparently we cannot upgrade to 3.7 yet (some issues with Python 3.7 distribution for us).

@srids gotcha. we have a release 2.1.1 upcoming in 2 days. we can try to publish 37 for macos. does that work for you?

you mean 36 for macos :) - yea that should work but think it will be consistent to publish 2.1.0 for 36 as its already done for Linux but not for MacOS.

@srids yes I mean 36. a release typically requires reviews and votes in apache software foundation. so if things are missing, we are fixing it in the next release :)

ic. sounds good to fix in 2.1.1 then. thanks.

Closed this issue as question answered.

Any plans to support Python 3.9?


What controls should be replaced from the 1% data?

Background
There are 4 types of controls in the Varchamp data: transfection control, positive control (morphology), positive control (localization), and negative control (morphology). We are revisiting the positive and negative controls because: 1) some variants are not what we thought they were, and 2) controls were chosen based on analyzing JUMP data and we want to confirm that they are actually pos/neg cons based on Varchamp data.
Positive localization control
Chloe asked if we have any suggestions from the 1% data. I would suggest taking one of the pathogenic variants that was sequenced and has both a high AUROC and a high confidence sequencing score (for both the WT and the Variant).
Positive and negative morphology controls
Chloe asked if I can confirm that SLIRP is an adequate negcon, and to select one of the candidate positive controls to replace PTK2B which came back as something else when sequencing. This is where we have issues. In the current analysis/data state, there is no distinguishable difference between any REF-VAR pair. This is because when we construct the control-control NULL, we get the complete range of AUROC values: from 0 all the way to .99 (maybe even 1.0). Thus, no morphology profile comes back as a hit. We expect that this could be because of the confocal z-plane thing, where random replicates with quite different z-planes throw off the whole analysis. This holds even if we throw away AGP, which suffers from this the most.
What to do

Select a new positive localization control. I need to organize results for 1% paper anyways, so will suggest a few pairs when I'm doing that.
For morphology poscons, maybe look at all of the wt-var morphology classifiers by eye that had high AUROC values (>0.8) and choose several with visually distinguishable morphology?
For morphology negcons, I'm afraid we can't do this right now. I'm not confident in our ability to pick out negcons by eye, since we know that many times we find significant associations in CellPainting datasets that reproduce known biology, yet are not visually distinguishable. I think we should revisit this with the next batch of data, after switching from confocal to widefield.
Continue to characterize the wt-var morphology issues. Perhaps it can be partially solved by trying to filter out wells with extreme z-plane values. I don't know what features we would use for unbiased, automated filtering, but I will think more about this.

Great!
Great!
Are there enough replicates of any individual samples in category 1 or 2 to use them as morphology neg cons? because morphology should not change from one replicate to another of the same sample. Of course, no morph neg con will work with the null being so variable but once that settles down, this could be a solution.
There are a number of approaches to filter out blurry images (if I'm right that this is how they look?)

use a pre-trained deep learning model. We never adopted it for mainstream use and I don't know why; presumably because we rarely have focus issues:
Yang SJ, Berndl M, Michael Ando D, Barch M, Narayanaswamy A, Christiansen E, Hoyer S, Roat C, Hung J, Rueden CT, Shankar A, Finkbeiner S, Nelson P (2018). Assessing microscope image focus quality with deep learning. BMC Bioinformatics 19(1):28962 / doi. GitHub. PMID: 29540156. PMCID: PMC5853029 https://bmcbioinformatics.biomedcentral.com/counter/pdf/10.1186/s12859-018-2087-4.pdf
Use individual metrics that indicate blurriness (usually these will be image-level metrics rather than cell-level metrics. These papers should tell you which are good. The first one also (maybe exclusively?) talks about training a classifier to recognize blurry images on a per-dataset basis but that seems overkill:
(a) Bray MA, Carpenter AE (2018). Quality Control for High-Throughput Imaging Experiments Using Machine Learning in CellProfiler. Methods Mol Biol 1683:89-112 / doi. pdf. GitHub. BBBC. PMID: 29082489. PMCID: PMC6112602  https://carpenter-singh-lab.broadinstitute.org/files/anne/files/111_Bray_MiMB_2018.pdf
(b) Bray, M-A, Fraser AN, Hasaka TP, Carpenter AE (2012). Workflow and metrics for image quality control in large-scale high-content screens. Journal of Biomolecular Screening 17(2):135–143 / PMID: 21956170. PMCID: PMC3593271 https://carpenter-singh-lab.broadinstitute.org/files/anne/files/56-Bray_JBiomolScreen_2011.pdf

Great, for 3, makes sense! It would be nice to keep negcons in the hopes that some day we can detect them.
For 4, I see. It really seems there's no choice but to reduce the technical noise introduced by the auto-focusing (in future data collections). Filtering out 'bad' images can only get us so far!

Here are 3 options for new mislocalization positive controls. I selected WT-VAR pairs that are clearly distinguishable, have similar intensity/protein abundance, and where the cells have a high count and look healthy for both WT and VAR.

HPRT1 His204Asp
WT:

VAR:

GMPPB Asp27His
WT:

VAR:

RAB33B Lys46Gln
WT:

VAR:

Ooof, those honestly seem pretty subtle to me! I can convince myself there is a difference but only if looking back and forth between them, it's not like a glance at an image would immediately make it obvious which category it's in.
If someone else feels they are consistently distinguishable and can verbalize how, then great - but if not I wonder if we should go with a backup plan of looking for samples where cell count is fairly normal but something like nucleus eccentricity (a very easy to see shape measure) is distinctive? Of course we don't have an infinite number of pairs to test so maybe there is no pair that differs strongly in that feature, we could try nucleus or cell area too.

The main difference that I see is that WT cells look rounder, and VAR cells look more spindly. I agree that it's very subtle - was hoping for something much more distinguishable!
I can try targeted features like you suggested.

Eccentricity might be even more visible for cells than for nucleus actually
so that may be a good route!

re poscons, I forgot to post when offline traveling:
Oh wow, well 2. GMPPB Asp27His is just spectacular to look at and seems extremely consistent in both versions (REF and VAR). It will rely on good segmentation to be detected since it’s pretty cytoplasmic in both cases, just has the extra plasma membrane that makes it distinct.
The others are more variable: perhaps useful if you want a milder poscon that is closer to the boundary of what we hope to find? I could go either way on that. If you pick a milder one, maybe 1 HPRT1 His204Asp
Is a bit better because it’s a bit more consistent well to well.

Thank you Jess!

We will sequence verify all your suggested clones!
Another suggestion for the localization positive control are AGXT variants.
AGXT

AGXT Ala85Asp

AGXT Asn22Ser

AGXT Asp201Asn

I like the idea of having a milder poscon closer to our cutoff boundary, could we perhaps drop a negcon to include both a mild and strong localization poscon? How useful do you think this is for analysis?
3 & 4. When you construct the control-control NULL using the negcons, is that the exact same negcon compared to itself (i.e. RHEB vs RHEB) or negcons compared to one another (i.e. RHEB vs. SLIRP)? Although the selection of these negcons were based off CPJUMP, I don't think we can assume these are our best negcons/morphology controls. Does the scrambled controls plate help at all? Do you see consistent morphological differences irrespective of well position across constructs there? If so, we may not have selected the best constructs. What happens if you compare the morphological profiles of all WTs against each other?


⚠ GitLab Server has degraded performance

In eea1d9b, GitLab Server (https://gitlab01.its-telekom.eu) experienced degraded performance:

HTTP code: 200
Response time: 11566 ms

Resolved: GitLab Server performance has improved in 97aaf2a.


Cannot locate config.json file

Forgive me for the questions. New to HACC and really like it.
My problem that it will not let me back up my config. I get a "Failed - network error" when trying to back up, and it kicks out the authentication so I have to put my HA path and LL token back in.
My volume is: ${USERDIR}/docker/hacc:/app/config.json
Trying to update to version 1.1 released today, but it will not update without repulling the image. I currently have 80 tiles configured and I do not want to lose all of that work.
I would be fine, if I could just find where the config file is stored so I could back it up.
Thanks.

The documentation was previously incorrect. The correct way to mount the data directory is:
-v ${USERDIR}/docker/hacc:/app/data
Ref: https://hacc.dev/install/#running-hacc
Give that a try and let me know if it works!

The correct path housing the config file is /app/data/config.json, try mapping that to see if you can get it out.
And then, when you update to 1.1, use this argument to map the correct folder if you want to persist the config:
-v ${USERDIR}/docker/hacc:/app/data
I recently fixed the documentation to reflect this as well: https://hacc.dev/install/#running-hacc

Now I am getting somewhere. By following the thread and creating the
config.json file in Linux first, I was able to get it to work, along with
your recommendation. It appears that the config.json file is populating.
Unfortunately a little too late and I lost 100 tiles and two days worth of
work before I got it working. :(
On Sun, Jan 31, 2021 at 11:15 PM Jake Burgy<EMAIL_ADDRESS>wrote:

The correct path housing the config file is /app/data/config.json, try
mapping that to see if you can get it out.
And then, when you update to 1.1, use this argument to map the correct
folder if you want to persist the config:
-v ${USERDIR}/docker/hacc:/app/data
I recently fixed the documentation to reflect this as well:
https://hacc.dev/install/#running-hacc
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/qJake/HADotNet.CommandCenter/issues/117#issuecomment-770551465,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AKZGW6INUPFHRTFALBHH2ADS4YTFTANCNFSM4W35PGUQ
.

--
PLEASE NOTE MY NEW EMAIL ADDRESS

Sorry to hear that. 😢
v1.1.x should be more stable in this regard, and as long as you have that path mapped, you can instruct your host system to back up that file regularly so you don't lose any more work.
Going to close this for now, if you experience this issue again, please comment / reopen. Thanks.


Mission author does not show up correctly if searching by author

It shows all missions as being solely authored by the author we are searching for, even if this is not the case

Fixed in d44b3c1bf6c3aac45b5d35063f274e03ef93351b


Patching Exploits

Fixing vote exploits:
spam vote: Do not allow another vote until all previous vote requests have given a response

spam fixes:
Make the ratelimit server side with profiles
make the ratelimit use ip addresses
dont allow multiple of the same titles to be posted in quick succession (wouldnt be as effective)

#260


I cannot reproduce the demo experiment

I try with code
from pastalib.pasta import PASTA
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

# Initialize pre-trained LLM
name = "/alg_vepfs/public/models/llama2-7b-hf"
model = AutoModelForCausalLM.from_pretrained(name, trust_remote_code=True, device_map="auto",
                                             torch_dtype=torch.float32)

tokenizer = AutoTokenizer.from_pretrained(name, trust_remote_code=True)

head_config = {"3": [17, 6, 12], "5": [24], "0": [17], "7": [13], "11": [16], "8": [28, 24], "4": [3]}

# Initialize the PASTA steerer
pasta = PASTA(
    model=model,
    tokenizer=tokenizer,
    head_config=head_config,
    alpha=0.01,  # scaling coefficient
    scale_position="exclude",  # downweighting unselected tokens
)

# Model Input
texts = [
    "Mary is a doctor. She obtains her bachelor degree from UCSD. Answer the occupation of Mary and generate the answer as json format."]

# ===== Without PASTA =====
inputs = tokenizer(texts, return_tensors="pt")
inputs.to('cuda:0')
outputs = model.generate(**inputs, max_new_tokens=100)
# print(outputs)
print(tokenizer.decode(outputs[0]))
print('*' * 20)
# ---------------------
# ["The answer should be in json format."]  # returns answer in the wrong format

# ===== With PASTA =====
inputs, offset_mapping = pasta.inputs_from_batch(texts)
# User highlights specific input spans
emphasized_texts = ["Answer the occupation of Mary and generate the answer as json format"]
# PASTA registers the pre_forward_hook to edit attention
with pasta.apply_steering(
        model=model,
        strings=texts,
        substrings=emphasized_texts,
        model_input=inputs,
        offsets_mapping=offset_mapping
) as steered_model:
    outputs = steered_model.generate(**inputs, max_new_tokens=128)

print(tokenizer.decode(outputs[0]))

It same both output is not a json format

Hi, the demo code is for huggyllama/llama-7b. The attention pattern of LLAMA2 will differ from LLAMA-7B and hence its head_config should be profiled specifically to be effective.  Right now, the config/head_config includes the config of steered heads for GPTJ and LLAMA-7B. The example code for LLAMA-7B has been also been reproduced (please see this). We will release the attention heads for LLAMA-2 in future.

same to llama-7b
name = "/alg_vepfs/public/models/llama-7b"
model = AutoModelForCausalLM.from_pretrained(name, trust_remote_code=True, device_map="auto",
                                             torch_dtype=torch.float32)
tokenizer = AutoTokenizer.from_pretrained(name, trust_remote_code=True)

and get a result

maybe need a  seed to reproduce demo experiment?

The greedy search is applied in the demo code and hence there should be no randomness. Can you comfirm the local model file are the exactly same as the open-sourced huggyllama/llama-7b, i.e., the same forward pass and weights that have not been fine-tuned. Since we conduct the profiling for huggyllama/llama-7b, the demo head_config should be applied to the same model.


Conflict when doing initial migration

Hi, with django 1.8, I get this error when running syncdb:
explorer.Query.created_by_user: (fields.E304) Reverse accessor for 'Query.created_by_user' clashes with reverse accessor for 'Query.last_executed_by'.
	HINT: Add or change a related_name argument to the definition for 'Query.created_by_user' or 'Query.last_executed_by'.
rosemeta.Query.last_executed_by: (fields.E304) Reverse accessor for 'Query.last_executed_by' clashes with reverse accessor for 'Query.created_by_user'.
	HINT: Add or change a related_name argument to the definition for 'Query.last_executed_by' or 'Query.created_by_user'.

Maybe I'm doing something wrong, just wanted to let you know.
EDIT: Fixed it by adding a related_name attribute to the created_by_user attribute of Query. Can do a PR

thanks @mdamien -- looks like this is a conflict with another Django app called rosemeta that happens to use the same model name. I don't think I'm going to change the related name since this is specific to your install. Appreciate the issue being filed nonetheless.
p.s. If anyone thinks I'm wrong and should use some kind of vendor-specific related name, feel free to chime in.

Oops, thanks a lot.


feature: Pill V3

The type of this PR is: Feature

This PR resolves CX-1695
Description
This PR adds the new V3 Pills and uses them depending on the current theme.
PR Checklist (tick all before merging)

[ ] I have included screenshots or videos to illustrate my changes, or I have not changed anything that impacts the UI.
[ ] I have tested my changes on iOS and Android.
[ ] I have added tests for my changes, or my changes don't require testing, or I have included a link to a separate Jira ticket covering the tests.
[ ] I have added a feature flag, or my changes don't require a feature flag. (How do I add one?)
[ ] I have documented any follow-up work that this PR will require, or it does not require any.
[ ] I have added an app state migration, or my changes do not require one. (What are migrations?)
[ ] I have added a changelog entry below or my changes do not require one.

Changelog updates
Changelog updates

Cross-platform user-facing changes

iOS user-facing changes

Android user-facing changes

Dev changes

Warnings

:warning:

❌ An error occurred while validating your changelog, please make sure you provided a valid changelog.

  Generated by :no_entry_sign: dangerJS against 29d0768a28af824d7b18cd56b07b4def5f008de3


Request is blocked. Please check your authorization token and Cosmos DB account firewall settings

Describe the bug
I have a Cosmos DB account with configured IP firewall.
I added my current IP to the allowed list.
Got error "Request is blocked." on adding data to a container.
To Reproduce

Configure IP firewall
Add current IP
Use Cosmos SDK to CreateItem

Expected behavior
The response should be successful.
Actual behavior
This code can create a database, can create a new container but cannot add items to the container due to 403

Provide a description of the actual behavior observed.
System.Exception: 'Response status code does not indicate success: Forbidden (403); Substatus: 0; ActivityId: 5f7338ca-ed44-45c9-8e34-5871a3546ace; Reason: (Message: {"Errors":["Request is blocked. Please check your authorization token and Cosmos DB account firewall settings."]}
ActivityId: 5f7338ca-ed44-45c9-8e34-5871a3546ace, Request URI: /apps/0156f92e-e3ce-40cc-b1ee-be8393bd1b32/services/29e75939-155e-4b51-ba5c-e2efa9dd8d7d/partitions/e9bdb85e-d6a5-44fc-8626-e505b9255756/replicas/132598680007213774p/, RequestStats: Please see CosmosDiagnostics, SDK: Windows/10.0.19042 cosmos-netstandard-sdk/3.15.2);'

Environment summary
SDK Version: 3.15.2
OS Version: Windows
Additional context
Add any other context about the problem here (for example, complete stack traces or logs).

This is not related to the SDK, the SDK is simply surfacing the failure happening on the service.
Please see https://docs.microsoft.com/en-us/azure/cosmos-db/troubleshoot-forbidden#solution

@ealsur but it works well using the Portal. 403 only from SDK

@ealsur any comments? I follow all steps from the docs, added my IP. it works well using the Portal. 403 only from SDK

@Marusyk ealsur is a very helpful engineer based in Seattle who has a day job. He works on the .NET SDK team and as such is well placed to explain and fix SDK issues. The SDK produces HTTP requests etc, as do all the other SDKs. He has no control over the permissioning issues.
Are you sure the client ip you're running from when you run the code "from SDK" is correct and/or whitelisted?
This really is extremely unlikely to be an SDK issue and running these sorts of questions through this repo is really counterproductive compared to using a site like stackoverflow which is more tuned for quick permanent answers re troubleshooting etc. You'll want to include the full response message. By all means come back and paste a link here - helpful people will traverse it and answer if they have time, but this issue is best closed as there is no reason to believe there is an issue with the actual SDK at this point.

@bartelink
I don't know who is ealsur, but he closed my issue and I need some explaining

Are you sure the client ip you're running from when you run the code "from SDK" is correct and/or whitelisted?

of course, as you can see below, it works from Azure Portal and it created a new container and event a new database.
The problem only with adding data into the container.

This project is open source. It's a SDK. I watch the repo.
While I "just want to share my thoughts", my point was and is:
a) the SDK is just code
b) the issue was closed as the code in the SDK can't influence the service denying the request - it's just the messenger
c) you're going to resolve the answer quicker by approaching this as a general troubleshooting problem with the service, rather than roundtripping to Seattle to the messenger who is stating this basic fact.
The permissioning for DML (creating docs) vs DDL (making containers etc) operations can very easily be different depending on your security configuration.

If you are still having issues please contact support.
One common issue that I'm aware of is if you double click the key in the portal it doesn't select the entire key and usually causes a few missing characters at the end of the key. Which then results in auth failures.

@Marusyk As explained, this is not an SDK issue. One potential aspect based on experience, is that the IP you believe the request is originating from (and thus you used to add to your firewall configuration) might not be the actual IP (in cases where you use proxies for example). The Azure Portal has independent configurations to allow requests to go through:

But there is nothing that can be changed from the SDK to fix this situation, that is the reason the issue is closed, it just does not apply to the SDK.
You can, as Jake mentioned, contact support, they might check the account telemetry and potentially see which is the IP the requests are actually departing from. If you are running the code in Azure, there is the configuration to: Accept connections from within public Azure datacenters

My Cosmos Configuration is:

The blocking of the request is not generated by the SDK, the SDK is just materializing the service response, it's the service the one blocking the request, so we cannot know the reason from the SDK perspective.
There could be a service side that is only affecting point operations (CreateItem call) and not metadata operations (CreateDatabase), but we cannot answer that here, this is not a Cosmos DB general support forum, we can only act on SDK bugs or issues.
Technically speaking, the CreateDatabase call is an HTTP call that goes to the Gateway, while the CreateItem is a TCP call that goes to the backend replica address (V3 SDK has Direct mode as default). If the Gateway calls are working and the TCP calls are failing, it could indicate an issue on the service and a support ticket is the best way.
If you disable Firewall and everything works, and you enable Firewall and it fails, then logically, the issue is with Firewall.
In your screenshot, I see you also have VPN enabled, another potential aspect could be the VPN, but again, not an SDK issue.

Thank you very much for this great explanation. It was exactly what I need. Thanks again.


windows11,when I close the cmd or powershell window It's not work

wsl.exe -d wsl-vpnkit service wsl-vpnkit start

Try running the command wsl.exe -d wsl-vpnkit service wsl-vpnkit start from within your WSL 2 distro instead of cmd or powershell.

Try running the command wsl.exe -d wsl-vpnkit service wsl-vpnkit start from within your WSL 2 distro instead of cmd or powershell.

@shuohao When you run explorer.exe . from that terminal within WSL 2, does it open properly?

@shuohao When you run explorer.exe . from that terminal within WSL 2, does it open properly?

yes. open propely

It may be related to the operating system version。 windows 11 22H2 home not work, but windows 11 21H2 business worked well

Glad it's working for one of your machines, although it should work for Home too.
The . at the end in the command explorer.exe . was important since I wanted to see if your Windows Explorer can open your home dir inside your WSL 2 distro.

Glad it's working for one of your machines, although it should work for Home too.
The . at the end in the command explorer.exe . was important since I wanted to see if your Windows Explorer can open your home dir inside your WSL 2 distro.

Sorry, I reinstalled the system..   windows 11 professional  edition


VS2015 crashes when closing project

When I close the NTVS project, VS crashes. I wait when WER collect information. Hopefully it would be available to you.
In case if this is related, I open project in VS, then close it, and reopen again, then I next time close project, VS crashes.
Environment
VS2015
NTVS 9-17-2015 Dev Build
Node 0.12
NPM 3.3.4
Event Viewer
Faulting application name: devenv.exe, version: 14.0.23107.0, time stamp: 0x559b7ead
Faulting module name: unknown, version: <IP_ADDRESS>, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x181b89f6
Faulting process id: 0xbe0
Faulting application start time: 0x01d0f2ea2039beb3
Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
Faulting module path: unknown
Report Id: cbdcf588-45bd-4825-b741-0f437d5d9e41
Faulting package full name:
Faulting package-relative application ID:

Is that all the information available in the event viewer?

Initially I start from reporting page, so I miss .NET Runtime event source
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
Stack:
   at Microsoft.NodejsTools.Project.NodejsProjectNode.OnIdleNodeModules(System.Object)
   at System.Threading.TimerQueueTimer.CallCallbackInContext(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.TimerQueueTimer.CallCallback()
   at System.Threading.TimerQueueTimer.Fire()
   at System.Threading.TimerQueue.FireNextTimers()
   at System.Threading.TimerQueue.AppDomainTimerCallback()

Also I look earleir in the Event log, and exactly the same exception happens to me earlier at least 2 times.
Also looks like timer which monitor changes in the node_modules does not disposed properly. https://github.com/Microsoft/nodejstools/blob/master/Nodejs/Product/Nodejs/Project/NodejsProjectNode.cs#L959

I have the same issue but at opening a solution:
Faulting application name: devenv.exe, version: 14.0.23107.0, time stamp: 0x559b7ead
Faulting module name: unknown, version: <IP_ADDRESS>, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x29f189dc
Faulting process id: 0x16ac
Faulting application start time: 0x01d0f475c99ee50a
Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
Faulting module path: unknown
Report Id: e4f44128-6069-11e5-9d9a-8243f1a82c6b

And the .NET Runtime
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
Stack:
   at Microsoft.NodejsTools.Analysis.AnalysisUnit.AnalyzeWorker(Microsoft.NodejsTools.Analysis.Analyzer.DDG, System.Threading.CancellationToken)
   at Microsoft.NodejsTools.Analysis.Analyzer.DDG.Analyze(Microsoft.NodejsTools.Analysis.Deque`1<Microsoft.NodejsTools.Analysis.AnalysisUnit>, System.Threading.CancellationToken)
   at Microsoft.NodejsTools.Analysis.JsAnalyzer.AnalyzeQueuedEntries(System.Threading.CancellationToken)
   at Microsoft.NodejsTools.Intellisense.VsProjectAnalyzer+AnalysisQueue+GroupAnalysis.Analyze(System.Threading.CancellationToken)
   at Microsoft.NodejsTools.Intellisense.VsProjectAnalyzer+AnalysisQueue.Worker(System.Object)
   at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart(System.Object)

Visual Studio start doing a restarting process and then VS2015 closes and open again. This happen at least once every day.

@jamesxv7 have you tried the latest dev build? I couldn't reproduce the issue, but it theoretically includes a fix - http://github.com/microsoft/nodejstools/releases
@kant2002 good find and thx for the additional stack trace. Indeed we should be properly disposing of the timer. Additionally we should verify that the fileNode is not null when we dequeue.

Nope, I'll patch and let you know. Thanks for the hint!

@mousetraps I have plenty of crashes for you :smile: not sure that all related to NTVS, that's why no reporting )))

@kant2002 well if they have NodejsTools in the namespace, it's a pretty good bet :wink:. Otherwise may as well report if you think it could possibly be related (we may not be able to do anything immediately, but if two ppl run into the same seemingly unrelated issue, then maybe it is indeed related).


Fixes resize support for oculus and cardboard

Obviously breaking change.
Maybe future tweaking might be need in the future depending of devices.

We could probably set a custom render stage in the futur to cull only once the scene and adjust only the rendering RTT


tortoise: store ballots separately from layers

close: https://github.com/spacemeshos/go-spacemesh/issues/3779
each ballot stores votes on X previous layers. ballots referenced in the layer store votes for another X layers and so on. this is clearly recursive and can't be used like this.

memory consistently around 300-400 mb. seems a bit high, but that can be explored separately

bors merge

bors merge


How to create HttpClientHandler later than configuration time

As dicussed briefly in #71:
Looking at the usage of services.AddHttpClient().ConfigurePrimaryHttpMessageHandler(), I'm wondering how to configure it when the necessary information is not available at configuration time.
Say that each time we want to use the HttpClient, we load a certificate (perhaps based on a fingerprint), with the intention of getting an HttpClientHandler that uses that particular certificate. Such information may not be available (or even remotely convenient) at configuration time, let alone for each endpoint.
How can we get a properly managed HttpClientHandler at a later stage, when we have all the information (including potential certificates) about a particular endpoint we are connecting to?
Note that we want the client handler's lifetime to be handled for us: don't create a new one for every request, to avoid opening tons of TCP connections, but don't keep one around indefinitely either, because DNS changes must be accounted for.

We also have this issue. We act as a provider for our partners and we wrap calls to a 3rd party service that requires us to have a unique client certificate for each partner we are sending the request on behalf of.
The problem is that the client certificate is set in the ConfigurePrimaryHttpMessageHandler() in the startup sequence. We store the client certificates in Azure Keyvault and will resolve these at runtime depending on the partner.
We could of course register a named client for each partner we have (about 180 today) and resolve the httpclient by name. This however requires us to restart the service each time a new partner is onboarded.
What are your recommendations on how to design this?

Any thoughts on this @Eilon?

Sorry @davidhagg I'm not an expert in this area. @rynowak - can you take a look?

We also have this issue. We act as a provider for our partners and we wrap calls to a 3rd party service that requires us to have a unique client certificate for each partner we are sending the request on behalf of.
The problem is that the client certificate is set in the ConfigurePrimaryHttpMessageHandler() in the startup sequence. We store the client certificates in Azure Keyvault and will resolve these at runtime depending on the partner.
We could of course register a named client for each partner we have (about 180 today) and resolve the httpclient by name. This however requires us to restart the service each time a new partner is onboarded.
What are your recommendations on how to design this?

I have the exact same situation...I need to load a cert at runtime from a secret vault based on context. The solution of using the service provider inside ConfigurePrimaryHttpmessageHandler()(https://github.com/aspnet/Extensions/issues/932#issuecomment-453832647) is sort of doable in that it provides a cleaner way of getting a cert, but there's no async capability and it makes context hacky.
I would also love some recommendations around this.

@davidfowl any suggestions?

@rynowak it would be very helpful to get your insights on this issue. If there is a work around or if we simply must live with it because it is by design. I appreciate any answer :-)

We don't have a feature that does this yet sorry.
I'm interested in your ideas about how this would behave, be implemented, and how you'd want to use it. What I think you're asking for the is the ability to pass additional information besides the name to a call to CreateClient and have it do something different - in this case use a different certificate.
The problem that this creates is that the name is the key. This is fundamental unit of both configuration and caching for HttpClient factory. So if you want to use a single name and multiple client-certificates, then the HttpClient factory system has to be aware of how that works - basically we would need to do have a compound key.
I think the reason why we're arriving here is that you want to create a separate HttpClientHandler instance for each remote host/cert pair - and you want the HttpClient factory to be aware of that requirement.
I want to try and nail down the requirements of this in more detail and also loop in some HttpClient experts.
@karelz @stephentoub @davidsh

Thanks for the update @rynowak. I understand that the current design makes it hard to change this since the pooling of handlers is one of the good things that were introduced with the new HttpClientFactory.
I'll try to explain our problem.
We communicate with a 3rd party service where we basically start a "session" on behalf of our customers. Each of our customers give us the client certificate that must be provided in order to communicate with the 3rd party service. The communication with the 3rd party service is done through a class in our solution that takes a HttpClient injected into the constructor. We keep all our customers client certificates in an Azure keyvault and the intention is to read the correct certificate depending on the incoming request data (i.e. which customers cert we should be using)
So the issue we are facing is that the factory to create a HttpClientHandler is setup at startup and this is where we set the client certificate to use.
Since we are using the same class to call our 3rd party service for many different customers we can't use the option to use the standard HttpClientFactory with a delegate to create a messagehandler like:
services.AddHttpClient().ConfigurePrimaryHttpMessageHandler(() => { ... })
since it would simply be impossible to distinguish the handler to use in the pool of handlers.
This pretty much leaves us with the option to have a named client for every customer. This would result in about 180 named clients (and hopefully more over time). Each with their own pool of handlers connected to a client certificate for that customer. This might be feasible but the big issue with this solution is that we will have to restart our application each time we onboard a new customer since that would require this code to be run again:
{
    var certificateProvider = sp.GetService<CertificateProvider>();

    var handler = new HttpClientHandler();
    handler.ClientCertificates.Add(certificateProvider.GetCertificate("CustomerName"));
    return handler;
});

I think the reason why we're arriving here is that you want to create a separate HttpClientHandler instance for each remote host/cert pair - and you want the HttpClient factory to be aware of that requirement.

Honestly I'd rather not have to deal with that. Speaking purely from the perspective of a developer wanting to make HTTP calls on an API, ignoring any preconceived notions or valid architecture issues that make this a bad idea, it sure is nice the way curl does it.
 curl -X GET \
   {url} \
   --key pk.pem \
   --cert cert.pem \
   --cacert ca.pem \
   -H 'Content-Type: application/json'

In curl if I need to include a private key or specific cert(s), I just add a flag.
In dotnet, I would see this as similar to Headers or Content on an HttpRequestMessage...a property or series of properties to provide certs for a single request.
This would require some framework logic (in the handler I assume) to recognize that I'm providing explicit certs and use them. But, it would allow the developer to implement the logic for finding and assigning the cert(s) inside a Typed Client, the ideal place to do this in my opinion. Once loaded from wherever the data is stored, it's as simple as adding a header or replacing a portion of the URL to include the certs.
I was perhaps misguided and am admittedly not a certificate expert, but this is how I assumed it would work when I started digging in, that I'd find and load certs from my Typed Client. Obviously curl and dotnet are not equal, but being able to execute a semi-basic curl and have my request work vs what it takes to make the same request happen in dotnet core is frustrating.
Thanks for the help @rynowak (and everyone else) on this.

I'm interested in your ideas about how this would behave, be implemented, and how you'd want to use it.

Having similar (albeit milder) requirements as @davidhagg, I am using a custom implementation in production. I will post it as inspiration for a suitable solution.
Before I go into details, I will argue that we are wrestling with the design of HttpClient and HttpClientHandler here. Ideally, we would either (1) create and dispose an HttpClient instance per call, or (2) we would inject a single, reusable instance that does not contain any endpoint-specific state. In either case, the pooling of the underlying TCP connection and whatnot would be hidden from us. ADO.NET basically uses option 1 described here (with the connection string as the unique identifier), and that has become conventional. That is want we want.
Anyway, things being as they are, here is the solution I am using to both prevent running out of sockets and still have configurability at any time:
	public interface IHttpClientFactory
	{
		HttpClient CreateClient();
		HttpClient CreateClient(HttpClientPurpose purpose);
	}
	// Factory implementation omitted for brevity, but described below
	public class HttpClientPurpose
	{
		public override bool Equals(object other) => other is HttpClientPurpose typedOther && String.Equals(this.UniqueName, typedOther.UniqueName, StringComparison.OrdinalIgnoreCase);
		public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(this.UniqueName);

		public string UniqueName { get; }
		public Func<HttpMessageHandler> MessageHandlerFactory { get; }

		public HttpClientPurpose(string uniqueName, Func<HttpMessageHandler> messageHandlerFactory)
		{
			this.UniqueName = uniqueName ?? throw new ArgumentNullException(nameof(uniqueName));
			this.MessageHandlerFactory = messageHandlerFactory ?? throw new ArgumentNullException(nameof(messageHandlerFactory));
		}

		internal static HttpClientPurpose GenericPurpose { get; } = new HttpClientPurpose("InternalGenericPurpose",
#if NETSTANDARD
			() => new HttpClientHandler()
#else
			() => new SocketsHttpHandler()
			{
				AutomaticDecompression = DecompressionMethods.GZip,
			}
#endif
		);
	}

The factory implementation will be temporarily caching message handlers per "purpose" (usually an endpoint) as described below.
The factory can create a client for a specific purpose, or a general-purpose one (parameterless overload).
The general-purpose overload simply passes HttpClientPurpose.GenericPurpose to the other overload. It is suitable for all requests that need no customization on the message handler level.
The HttpClientPurpose takes a factory Func to create the underlying HttpClientHandler (or actually its base type, HttpMessageHandler), which can specify a connection timeout, a client certificate, etc.
The HttpClientPurpose takes a unique name, letting the factory know which purposes are the same and can thus use the same cached message handler.
The HttpClientPurpose can be constructed at any point. In other words, we can load certificates at will and construct a purpose that utilizes them.
The factory implementation stores message handlers in an IMemoryCache for 240 seconds (matching the default time TCP connections are kept open). On eviction from the cache, it moves them to a second cache, which holds "expiring" message handlers. On eviction from there after another 240 seconds, it disposes them. The purpose of the second cache is to delay the disposal of handlers that may still be working on a request that was started when it was in the first ("active") cache.
Clearly, the disadvantage here is that message handlers could technically be disposed while the client is still using them, i.e. if a request takes more than 240 seconds (I hope you're not doing that) or if the client is keeping HttpClients around.
The second cache should probably be replaced by another system, as items could be evicted prematurely (i.e. while still in use) if memory is running out.

We are having a similar issue, we are utilizing the IHttpClientFactory to avoid opening unnecessary TCP connections (we had this issue before when with per request created client).
Our requirement is to use Digest authentication when the actual credentials should be set at run-time at each request rather at configure time. See the code below:

DI services configuration:
public static ServiceCollection CreateServices() { var serviceCollection = new ServiceCollection(); serviceCollection.AddHttpClient("WithDigestAuthentication")               .ConfigurePrimaryHttpMessageHandler(() => new DigestAuthenticationHandler()); return serviceCollection; }

Custom message handler
`public class DigestAuthenticationHandler : HttpClientHandler
{
public const string Username = "Digest.Username";
public const string Password = "Digest.Password";
  private const string AuthType = "Digest";

  protected override async Task<HttpResponseMessage> SendAsync(
      HttpRequestMessage request,
      CancellationToken cancellationToken)
  {
      // Nasty hack to get around
      // `Properties can only be modified before sending the first request.` error :(
      if (this.Credentials == null)
      {
          var credCache = new CredentialCache();
          var networkCredential = new NetworkCredential(
              request.Properties[Username].ToString(),
              request.Properties[Password].ToString());

          credCache.Add(request.RequestUri, AuthType, networkCredential);
          this.Credentials = credCache;
      }

      return await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
  }

}`

Code that adds actual credentials to the HttpRequestMessage.Properties as advised in Make HTTP requests using IHttpClientFactory in ASP.NET Core
      private HttpRequestMessage WithCredentials(HttpRequestMessage request)       {           request.Properties[DigestAuthenticationHandler.Username] = this.username;           request.Properties[DigestAuthenticationHandler.Password] = this.password;           return request;       }
The problem is that once HttpMessageHandler.Credentials are set these cannot be re-set on a subsequent request.

Can you please advise how to overcome this issue?
We thought about creating a pool of preconfigured "WithDigestAuthenticationXYZ" HttpClients and selecting one at runtime via our custom client factory method that would check whether given client Credentials are equal. When the pool is drained out we can revert to just returning a new instance of HttpClient. What do you think?

@tsaluszewski Beware that if you you use pooling, you probably want new clients every now and then, because otherwise DNS changes will not be taken into account. Also, I'm not sure if long-lived could break, for example if a firewall ends a TCP connection after 15 idle minutes. (But perhaps they know how to deal with that.)
I am quite satisfied with the results of the solution I posted just above your comment. It has been in used for months. I recommend a careful read of that post. It might just help complete your implementation.

Thank you @Timovzl  for you input! However I do not want to new clients every now and then, as I had it before and ran into too many open handles (over 13K) in linux container in AWS ECS :(
Here is the solution that works for me, and maybe someone can re-use it:
`    public class DigestAuthenticationHandler : HttpClientHandler
{
public const string Username = "Digest.Username";
public const string Password = "Digest.Password";
    private const string AuthType = "Digest";

    private readonly ILogger logger;
    private readonly SemaphoreSlim semaphore = new SemaphoreSlim(1, 1);

    public DigestAuthenticationHandler(ILogger logger)
    {
        this.logger = logger;
    }

    protected override async Task<HttpResponseMessage> SendAsync(
        HttpRequestMessage request,
        CancellationToken cancellationToken)
    {
        if (request.Properties.TryGetValue(Username, out var userValue) && string.IsNullOrEmpty(userValue as string))
        {
            throw new HttpClientException($"{Username} is not specified!");
        }

        if (request.Properties.TryGetValue(Password, out var passwordValue) && string.IsNullOrEmpty(passwordValue as string))
        {
            throw new HttpClientException($"{Password} is not specified!");
        }

        var (username, password) = ((string)userValue, (string)passwordValue);

        await this.semaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
        try
        {
            if (this.Credentials == null)
            {
                this.Credentials = CreateCredentials(request, username, password);
                return await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
            }
            else if (HasSameCredentials(this.Credentials, request, username, password))
            {
                return await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
            }
            else
            {
                this.logger.Error(
                    "Pooled HttpClient for {0} has different credentials than requested! "
                    + "Creating new unmanaged HttpClient!", request.RequestUri);

                return await SendWithNewClientAsync(request, cancellationToken, username, password).ConfigureAwait(false);
            }
        }
        finally
        {
            this.semaphore.Release();
        }
    }

    private static async Task<HttpResponseMessage> SendWithNewClientAsync(
        HttpRequestMessage existingRequest,
        CancellationToken cancellationToken,
        string username,
        string password)
    {
        // New request required due to "The request message was already sent. Cannot send the same request message multiple times."
        // https://stackoverflow.com/questions/18000583/re-send-httprequestmessage-exception/18014515
        var request = await existingRequest.CloneAsync().ConfigureAwait(false);
        var handler = new HttpClientHandler { Credentials = CreateCredentials(existingRequest, username, password) };
        var client = new HttpClient(handler);

        return await client.SendAsync(request, cancellationToken).ConfigureAwait(false);
    }

    private static CredentialCache CreateCredentials(HttpRequestMessage request, string username, string password)
    {
        var credCache = new CredentialCache();
        var networkCredential = new NetworkCredential(username, password);
        credCache.Add(request.RequestUri, AuthType, networkCredential);
        return credCache;
    }

    private static bool HasSameCredentials(ICredentials credentials, HttpRequestMessage request, string username, string password)
    {
        var cred = credentials.GetCredential(request.RequestUri, AuthType);
        return cred.UserName == username && cred.Password == password;
    }
}

}`

@tsaluszewski Thanks for sharing your solution as well.

However I do not want to new clients every now and then, as I had it before and ran into too many open handles (over 13K) in linux container in AWS ECS :(

My solution specifically uses a strategy to avoid that. Before, we were simply creating and disposing an HttpClient per call, and the exact same problem is what led me to creating the solution I described.
Now, each handler lives for 2 * 240 minutes. For each distinct configuration (i.e. for each endpoint in the very worst case, but most endpoints simply share the default configuration in practice), there are at most two handlers at any given time.

We're going to look into solve these problems via some mechanism in 5.0.
The problem as I understand it:

HttpClientHandler/SocketsHttpClientHandler associate authN/proxy/network related settings with the handler instance
IHttpClientFactory is a framework for configuring the outgoing http stack
IHttpClientFactory also encourages reuse of the underlying handlers

These three points are in conflict 😆

HttpClientHandler/SocketsHttpClientHandler associate authN/proxy/network related settings with the handler instance
IHttpClientFactory is a framework for configuring the outgoing http stack
IHttpClientFactory also encourages reuse of the underlying handlers

These three points are in conflict 😆

Would you please explain more details? For me, reusing handlers with IHttpClientFactory should be a must. The users shouldn't worry about the underlying problems such as 'Socket Exhaustion'.

I would summarize the problem as: To avoid socket exhaustion, IHttpClientFactory is a necessity. However, we tend to need different configurations (client certificate, timeout, ...) for different endpoints, and we do not always have this information available on startup.

@Timovzl Totally agreed! In addition, it should be considered not only for WebHost(Configure in Startup.cs), but also for GenericHost which is used for Console apps.

To avoid socket exhaustion, IHttpClientFactory is a necessity

Can someone summarize for me why this is believed to be the case?

To avoid socket exhaustion, IHttpClientFactory is a necessity

Can someone summarize for me why this is believed to be the case? Is it because a ton of distinct components all want to share the same instance and can't otherwise?

@stephentoub
Keeping an instance around forever wasn't a good solution in 2.0 when this feature was added because you'd end up with stale DNS. Keep in mind that we're talking about environments where you keep HTTP connections open for days.
Now that we have SocketsHttpHandler you can do this and still avoid the stale-DNS problem by configuring PooledConnectionLifetime. However, we haven't done enough to get the word out, so people are still convinced that the client factory is the only solution. The property has no documentation at all 😢 I just sent a PR to suggest this in the client factory docs https://github.com/aspnet/AspNetCore.Docs/pull/15854

HttpClientHandler/SocketsHttpClientHandler associate authN/proxy/network related settings with the handler instance
IHttpClientFactory is a framework for configuring the outgoing http stack
IHttpClientFactory also encourages reuse of the underlying handlers
These three points are in conflict 😆

Would you please explain more details? For me, reusing handlers with IHttpClientFactory should be a must. The users shouldn't worry about the underlying problems such as 'Socket Exhaustion'.

@LeaFrock
Sure.
A client handler (SocketsClientHandler) is for all intents and purposes a connection pool. It represents a set of a connections to a set of hosts. This is why keeping a long-lived on, or reusing/sharing one is efficient, because you can share the connections you don't have to wait for them to be reestablish.
Features like client certificates or proxy settings describe how those connections are made. You cannot share the same connections to the same host with two different client certificates - you're asking to do something impossible.
Since in .NET a client handler represents a pool of connections, that is where settings related to client certificates and proxy servers life. You could argue that it's inconvenient for you, but that's the design .NET has.
So back to my three statements.

Users want to multiplex proxies and certificates (including multiple certs and proxies to the same hosts)
They want this to be easy to code up (using client factory)
They want this to be efficient (reuse connections where possible)

These desires conflict with how all of this is designed.

Now that we have SocketsHttpHandler you can do this and still avoid the stale-DNS problem by configuring PooledConnectionLifetime

Right.  That's why I was asking :)

Now that we have SocketsHttpHandler you can do this and still avoid the stale-DNS problem by configuring PooledConnectionLifetime

Right. That's why I was asking :) Thanks.

It would be great to see improved CoreFx docs on this, or something else to help get the word about about how users should using HttpClient in 2019 (blog)

It would be great to see improved CoreFx docs on this

I agree.
cc: @karelz

@rynowak Thank you very much.

Users want to multiplex proxies and certificates (including multiple certs and proxies to the same hosts)

That's the scenario we meet and that's why we're here to discuss this question.

They want this to be easy to code up (using client factory)

Certainly we hope to code up easily, but not define that this problem must be resolved by using client factory. I thought some implementation of IHttpClientFactory could help, but now I understand I'm wrong.

They want this to be efficient (reuse connections where possible)

That's the goal. Now we have to create a lot of HttpClient instances for each proxy which may cause 'Socket Exhaustion' or else. Also, if we want to be as efficient as possible currently, the instances have to be manually managed, maybe in a dictionary(Key-Value : Proxy/Cert-HttpClient). When the proxy/cert is not available(maybe out of date or else), we need to remember that the HttpClient instance should be removed and disposed. I think it's not elegant, and there should be some official best practice to inform the developers how to deal with this problem. We hope our codes run safely and efficiently in this scenario.
Glad to see that DNC notice the problem, and I'm looking forward to a better solution.

Now that we have SocketsHttpHandler you can do this and still avoid the stale-DNS problem by configuring PooledConnectionLifetime.

@rynowak  Thank you for clearing that up! That definitely helps solve the problem. I had no idea that could serve as an alternative to the factory.
A few follow-up questions just to make sure that we use this correctly:
From the updated docs:

Create an instance of SocketsHttpHandler when the app starts and use it for the life of the app.
Configure xref:System.Net.Http.SocketsHttpHandler.PooledConnectionLifetime to an appropriate value based on DNS refresh times.
Create HttpClient instances using new HttpClient(handler, dispostHandler: false) as needed.

We could technically create the SocketsHttpHandler at any time, such as lazily if that helps, correct? As long as we create one per uniquely configured endpoint and reuse it.
We only need a separate SocketsHttpHandler per configuration, correct? E.g. if we have two endpoints that each use no certificate and no other alternative configuration, we could simply use the same instance for them if we wanted to?
For PooledConnectionLifetime, what would generally be "an appropriate value based on DNS refresh times"?
What is the default value for PooledConnectionLifetime? If it does have a proper default, we can keep our hands of such details, which protects us from trying to configure things we have little knowledge about.

We could technically create the SocketsHttpHandler at any time, such as lazily if that helps, correct?

Correct.  Just keep in mind that it is the handler that owns its own connection pooling resources, so a) you still want to limit the number you create to as few as you need (if you need another because you want different settings applied to the pooled connections, that's a good reason to create another), and b) you want to Dispose of the handler when you're done with it if the app is going to keep on running after, as otherwise connections might end up staying open longer than you'd like.

We only need a separate SocketsHttpHandler per configuration, correct? if we have two endpoints that each use no certificate and no other alternative configuration, we could simply use the same instance for them if we wanted to?

Correct. And in fact in the situation you cite, you really should strive to use the same instance.  Otherwise, you may end up with more connections than is your ideal minimum.

For PooledConnectionLifetime, what would generally be "an appropriate value based on DNS refresh times"?

Using the pooled connection lifetime to avoid stale DNS, you'd want to factor in how common it is for your target server's DNS information to change.  In general with DNS TTL, an hour is considered short and a day is considered long, though in the wild TTLs can be found to range anywhere from a minute to a few days.  At the same time, connection pooling is used in order to minimize the costs of establishing new connections, but even though establishing connections is relatively expensive when compared to just using an existing one, the overhead we're generally talking about is measured anywhere from milliseconds to seconds, so even with a really short connection lifetime, you're unlikely to see the overheads show up, and you can tune your app as you see fit without feeling badly about it.  In fact, if memory serves, HttpClientFactory defaults to something around 2 minutes.

What is the default value for PooledConnectionLifetime?

Infinite, as by default SocketsHttpHandler wants to avoid tearing down connections that are actively being used over and over.  However, there's also PooledConnectionIdleTimeout, which is how long a connection can remain open in the pool unused before it's closed, and that defaults to 2 minutes.

@stephentoub Many thanks!
@LeaFrock I'm closing this issue, as I consider it adequately covered. If you have any unanswered follow-ups, we can always re-open it.


Is Generic Host suitable for runnings apps in IIS?

Is Generic Host suitable for runnings apps in IIS or it is meant only being started from the command line or a a service?

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 26c04398-d05e-490a-30b9-e677804012f5
Version Independent ID: a534ebf2-ca56-d352-401e-5f3d01b30ac0
Content: Host in ASP.NET Core
Content Source: aspnetcore/fundamentals/host/index.md
Product: asp.net-core
GitHub Login: @guardrex
Microsoft Alias: riande

Hello @simon-michaud - Since it isn't recommended for web workloads, it would be more suitable as a service. We recommend it by virtue of showing a service sample. The sample does run as a console app, but that's more geared towards testing and debugging.
@Tratcher, We already say 'not for web workloads,' but I'd like to call out more explicitly that we recommend a service-based hosting set-up for production environments at this time. Any objections?

?  I don't know how much more you really need to add here.

@simon-michaud Thanks for asking.

Maybe it should be more explicit that is has nothing to do with web apps /
web servers, it is promoted as an asp.net core feature but as no relation
to it at all in its purpose.
I understand you plan is to make this host the one host for everything, but
for now it is specifically for non-asp.net core scenarios.
On Tue, Jun 12, 2018, 10:53 Chris Ross<EMAIL_ADDRESS>wrote:

?  I don't know how much more you really need to add here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/aspnet/Docs/issues/6995#issuecomment-396618606, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGLPG9aXi4MMJTkN-QoBhSIIfv141GQAks5t79XOgaJpZM4UkOBs
.

has nothing to do with web apps / web servers

... but that is what is says ...

Generic Host (ASP.NET Core 2.1 or later) – Suitable for hosting non-web apps (for example, apps that run background tasks). In a future release, the Generic Host will be suitable for hosting any kind of app, including web apps. The Generic Host will eventually replace the Web Host.

... not "non-asp.net core scenarios" ... just "non-web app" scenarios.

Ok, but still does not clarify if background jobs are suitable to be run
from IIS or should be console/service only... background job framework do
exists in asp.net/IIS context (Hangfire for example, lot more elaborate,
but you get the idea)  Wondered if it was for that purpose or not.
On Tue, Jun 12, 2018, 11:08 Luke Latham<EMAIL_ADDRESS>wrote:

has nothing to do with web apps / web servers
... but that is what is says ...
Generic Host (ASP.NET Core 2.1 or later) – Suitable for hosting non-web
apps (for example, apps that run background tasks). In a future release,
the Generic Host will be suitable for hosting any kind of app, including
web apps. The Generic Host will eventually replace the Web Host.
... not "non-asp.net core scenarios" ... just "non-web app" scenarios.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/aspnet/Docs/issues/6995#issuecomment-396624337, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGLPG-IB4sMEm0EciNZHhJjzEQG24c-hks5t79l9gaJpZM4UkOBs
.

I agreed, which is why I asked @Tratcher.
We won't update the language unless he approves ... "In @Tratcher We Trust" is printed on MS money. :smile:

Background jobs can be run as part of your web app or non-web app, such as hangfire in an IHostedService:
https://github.com/geirsagberg/HostFun/blob/master/HostFun/HangfireService.cs
Right now the limiting distinction is that the web work loads don't work in the generic host, and such you must use the WebHost in IIS. You could combine this with background tasks if you like, but that's not relevant to the choice of host.


Add missing includes (?)

My cpp-fu is not good enough, but I was getting the following errors, when those two includes are missing:
make: Entering directory '/home/u/code/tree-sitter-fsharp/build'
  CXX(target) Release/obj.target/tree_sitter_fsharp_binding/bindings/node/binding.o
  CC(target) Release/obj.target/tree_sitter_fsharp_binding/src/parser.o
  CXX(target) Release/obj.target/tree_sitter_fsharp_binding/src/scanner.o
../src/scanner.cc:11:12: error: no member named 'string' in namespace 'std'
using std::string;
      ~~~~~^
../src/scanner.cc:259:12: error: no member named 'reverse' in namespace 'std'
      std::reverse(runback.begin(), runback.end());
      ~~~~~^
2 errors generated.

Feel free to close, if it it's not something that is missing.

Hmm, compiling a fresh clone on my machine does not seem to produce the error.
I've set up some CI for the repo now, so let us see if it fails there :)

You are indeed correct, @vzarytovskii. It seems to be failing on linux without the imports.

You are indeed correct, @vzarytovskii. It seems to be failing on linux without the imports.

Yeah, sorry, forgot to add - I'm testing on WSL, thanks for confirming it!


base_path & target_path when testing STPLS3D

Thank you for sharing great works!
While i was testing mask3D using STPLS3D after Training,
I faced error "python: can't open file '~ / Mask3D/merge_exports.py': [Errno 2] No such file or directory "
So, i moved 'merge_exports.py' from '~ / Mask3D/scripts/stpls3d/merge_exports.py' to '~/Mask3D/merge_exports.py'
However, after this error solved, i faced error "FileNotFoundError: [Errno 2] No such file or directory: 'INSERT_WORKING_DIRECTORY/benchmark_02/pred_mask'".
The problem is that I can't find directory which has "benchmark_02/pred_mask".
Could you tell me how should i set base_path and target_path in this "merge_exports.py"?
and what is this file for?
I attached my "~Mask3D/scripts/stpls3d/stpls3d_benchmark.sh" and "~Mask3D/merge_exports.py" below.
Thank you!
<~Mask3D/merge_exports.py>
import os
import shutil
from glob import glob
from tqdm import tqdm

#⭐
base_path = "INSERT_WORKING_DIRECTORY"
vs03 = f"{base_path}/benchmark_03"
vs02 = f"{base_path}/benchmark_02"

#⭐
target_path = "INSERT_TARGET_DIRECTORY"

print("COPY MASKS FILES 1/2 ...")
shutil.copytree(f"{vs02}/pred_mask", f"{target_path}/pred_mask_02")
print("COPY MASKS FILES 2/2 ...")
shutil.copytree(f"{vs03}/pred_mask", f"{target_path}/pred_mask_03")

for scene03 in tqdm(glob(f"{vs03}/*.txt")):
    instances = []
    with open(scene03, "r") as file03:
        while line := file03.readline().rstrip():
            mask_path, class_id, score = line.split(" ")

if int(class_id) in [1, 3, 4, 7, 8, 11, 12, 13]:
                instances.append(
                    f'{mask_path.replace("pred_mask", "pred_mask_03")} {class_id} {score}'
                )
                print(instances[-1])
            else:
                print(
                    f'DELETE {target_path}/{mask_path.replace("pred_mask", "pred_mask_03")}'
                )
                os.remove(
                    f'{target_path}/{mask_path.replace("pred_mask", "pred_mask_03")}'
                )

with open(f'{vs02}/{scene03.split("/")[-1]}', "r") as file02:
            while line := file02.readline().rstrip():
                mask_path, class_id, score = line.split(" ")

if int(class_id) not in [1, 3, 4, 7, 8, 11, 12, 13]:
                    instances.append(
                        f'{mask_path.replace("pred_mask", "pred_mask_02")} {class_id} {score}'
                    )
                    print(instances[-1])
                else:
                    print(
                        f'DELETE {target_path}/{mask_path.replace("pred_mask", "pred_mask_02")}'
                    )
os.remove(
                        f'{target_path}/{mask_path.replace("pred_mask", "pred_mask_02")}'
                    )

with open(f'{target_path}/{scene03.split("/")[-1]}', "w") as fout:
        for line in instances:
            fout.write(f"{line}\n")

@YEOMJINSEOP can you please tell me how you solved this? I have exactly the same problem.


About Visualize experiments

Hello and thank you for your very meaningful work! I've been exploring how to do visualization experiments with KAN lately, do you have any good suggestions? Looking forward to hearing from you. Best regards.

@Guoli-w Hi there, thanks for the feedback!
Could you please elaborate on what kind of visualization you need?

Thank you for your response. I apologize that I didn't express myself clearly. I would like to visualize this effect.


Add demo for notification dismiss.

This also fixes the issue that notification with the same id (sent from onNotificationTap) won't show again, which is caused by setAutoCancel(true).

This is for #3625


Patch Party Deliverables for 7/17

CSV file on all repos that have capistrano (everything in the deployable scope) and the folowing info:

[ ] honeybadger gem installed
[ ] capistrano/honeybadger as required in the Capfile
[ ] matches to an existing honeybadger project

@tallenaz will take:

[ ] generate a CSV on all deployable repos with current status on honeybadger gem installed and capistrano/honeybadger in the Capfile


[21.05 staging] astroid: 2.5.1 -> 2.5.3

Motivation for this change
The build for astroid (with python 3.9) was broken.
Was looking at hydra and this seemed like low-hanging fruit. I tried building:

python37Packages.pylint (+ astroid)
python38Packages.pylint (+ astroid)
python39Packages.pylint (+ astroid)
some random leaf packages that mentioned astroid or pylint from python39Packages.

I didn't see any issues.
Should fix quite some hydra builds for release-21.05.
See commit message for some more info.
I chose to not bump this more than 2 patch revisions to reduce any breakage as much as possible. Someone that's actually using this package could bump it higher if needed.
Changelogs:

https://github.com/PyCQA/astroid/releases/tag/astroid-2.5.2
https://github.com/PyCQA/astroid/releases/tag/astroid-2.5.3

Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[x] Fits CONTRIBUTING.md.

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/prs-ready-for-review/3032/643