Wim Leers: High concurrency Composer
On behalf of Acquia I’m currently working on Drupal’s next big leap: Automatic Updates & Project Browser — both are “strategic initiatives”.
The foundation for both will be the (API-only, no UI!) package_manager
module, which builds on top of the php-tuf/composer-stager
library. We’re currently working hard to get that module committed to Drupal core before 10.1.0-alpha1
.
Over the last few weeks, we managed to solve almost all of the remaining alpha blockers (which block the core issue that will add package_manager
to Drupal core, as an alpha
-experimental module. One of those was a random test failure on DrupalCI, whose failure frequency was increasing over time!
A rare random failure may be acceptable, but at this point, ~90% of test runs were failing on one or more of the dozens of Kernel
tests … but always a different combination. Repeated investigations over the course of a month had not led us to the root cause. But now that the failure rate had reached new heights, we had to solve this. It brought the team’s productivity to a halt — imagine what damage this would have done to Drupal core’s progress!
A combination of prior research combined with the fact that suddenly the failure rate had gone up meant that there really could only be one explanation: this had to be a bug/race condition in Composer itself, because we were now invoking many more composer
commands during test execution.
Once we changed focus to composer
itself, the root cause became obvious: Composer tries to ensure the temporary directory is writable and avoids conflicts by using microtime()
. That function confusingly can return the time at microsecond resolution, but defaults to mere milliseconds — see for yourself.
With sufficiently high concurrency (up to 32 concurrent invocations on DrupalCI!), two composer
commands could be executed on the exact same millisecond:
We could switch to microtime(TRUE)
for microseconds (reduce collision probability 1000-fold) or hrtime()
(reduce collision probability by a factor of a million). But more effective would be to avoid collisions altogether. And that’s possible: composer
always runs in its own process.
Simply changing
sys_get_temp_dir() . '/temp-' . md5(microtime());
to
sys_get_temp_dir() . '/temp-' . getmypid() . '-' . md5(microtime());
is sufficient to safeguard against collisions when using Composer in high concurrency contexts.
So that single line change is what I proposed in a Composer PR a few days ago. Earlier today it was merged into the 2.5 branch — meaning it should ship in the next version!
Eventually we’ll be able to remove our work-around. But for now, this was one of the most interesting challenges along the way 🙂
Storing sensitive data using Podman secrets: Which method should you use?
Podman supports two ways for storing sensitive data: using raw Podman secrets or creating Kubernetes secrets using Podman. Read More at Enable Sysadmin
The post Storing sensitive data using Podman secrets: Which method should you use? appeared first on Linux.com.
GNU Health: Leading Public Mental Health Hospital in Argentina embraces GNU Health
The World Health Organization defines health as a state of complete physical, mental and social well-being and not merely the absence of disease or infirmity.
Unfortunately, this definition is far from being a reality in our societies. Instead of embracing the system of health, we live in the system of disease, ruled by a reactive, reductionist and unsustainable model of healthcare. The beautiful noble art and science of medicine is ill. Financial institutions and giant technological corporations are removing the human factor from medicine, transforming people and patients into clients. They are reducing the non-negotiable human right to healthcare to a privilege of a few.
Coming back to the formal definition of health, in the current system of disease very little is taken into account from the social and mental well-being . Today, many people with mental health conditions not only have to deal with the physiopathological aspects of the disorder, but also with the stigma, exclusion and invisibilization from the society.
But there is hope. Medicine is a social science, and GNUHealth is a social project with some technology behind. That feeling of optimism and hope has been reinforced in last week trip to Argentina and their people. In the end, medicine is about people interacting and taking care of people. Is about people before patients. I know them well, because I did my medical career in Argentina.
The Mental Health Hospital has chosen GNUHealth to improve the management of the institution resources, as well as to provide the best medical care for their community, both in outpatient and inpatient settings. Being able to properly identify every person who needs attention, and knowing the socio-sanitary, medical and clinical history in real time will make a big difference in the care of the individual.
The implementation of GNUHealth in this health institution will be lead by Prof. Dr. Fernando Sassetti and the department of public health studies of the University of Entre Ríos in the context of the GNU Health Alliance of Academic and Research Institutions agreement signed with GNU Solidario.
Health is an equilibrium of the inseparable and interconnected physical, social, mental and spiritual domains. Medicine is about taking into consideration and maintaining this body-mind-spirit-environment balance. This holistic approach to medicine is encoded in the genome of every nurse, psychologist, social worker and doctor from the Mental Health Hospital and the Primary care centers I got to know during these years in Entre Ríos, Argentina.
Links / References
Un software Libre para mejorar las políticas de salud: https://www.eldiario.com.ar/253548-un-software-para-mejorar-las-politicas-de-salud/
Hospital Escuela de Salud Mental : http://www.hesm.gob.ar/
Audiovisual institucional Hospital Escuela de Salud Mental: https://www.youtube.com/watch?v=Jx08WyfKRIE&t=12s
GNU Health: https://www.gnuhealth.org
Pinacoteca de SP: Placa alerta para furto de celulares | SOS São Paulo
Video by via Dailymotion Source A Pinacoteca de São Paulo instalou um aviso na entrada principal do museu em que orienta visitantes a não usarem aparelhos telefônicos nos arredores da instituição. “Não use seu celular aqui. Perigo de furto”, diz a placa, colocada rente ao portão. O espaço cultural fica próximo à Estação da Luz,…